Debian Codegraph @

t/slaves.t

raw
1 BEGIN { $|=1; $^W=1; }
2 use Test;
3 use Tk;
4
5 plan test => 12;
6
7 my $mw = MainWindow->new;
8
9 $x=$y=0;
10 foreach $geom ( qw/ pack place grid form / ) {
11 $f=$mw->Toplevel(qw/-bd 4 -relief solid /);
12 $f->title($geom);
13 foreach ( 1 .. 3 ) {
14 @p = ();
15 if ($geom eq 'place') {
16 $x+=20;
17 $y=$x;
18 @p=('-x', $x, '-y', $y);
19 }
20 $f->Label(-text => $_)->$geom(@p);
21 }
22 $s="${geom}Slaves";
23 #print "$geom slaves=", join(' ', $f->$s), "!\n";
24 foreach $s ($f->$s) {
25 ok( sub { return ( ref( $s ) ) ? 1 : 0 }, 1, "$geom slave '$s' not a reference.");
26 }
27 }