Lines Matching defs:ok
16 *{$caller.'::ok'} = \&ok;
31 ok( $foo eq $bar, 'foo is bar' );
43 The basic unit of Perl testing is the ok. For each thing you want to
44 test your program will print out an "ok" or "not ok" to indicate pass
45 or fail. You do this with the ok() function (see below).
59 =item B<ok>
61 ok( $foo eq $bar, $name );
62 ok( $foo eq $bar );
64 ok() is given an expression (in this case C<$foo eq $bar>). If it's
67 ok() prints out either "ok" or "not ok" along with a test number (it
70 # This produces "ok 1 - Hell not yet frozen over" (or not ok)
71 ok( get_temperature($hell) > 0, 'Hell not yet frozen over' );
73 If you provide a $name, that will be printed along with the "ok/not
74 ok" to make it easier to find your test when if fails (just search for
80 ok( @stuff, 'I have some stuff' );
86 sub ok ($;$) {
87 $Test->ok(@_);
132 ok( defined($btaste) and ref $btaste eq 'Film', 'new() works' );
134 ok( $btaste->Title eq 'Bad Taste', 'Title() get' );
135 ok( $btaste->Director eq 'Peter Jackson', 'Director() get' );
136 ok( $btaste->Rating eq 'R', 'Rating() get' );
137 ok( $btaste->NumExplodingSheep == 1, 'NumExplodingSheep() get' );
142 ok 1 - new() works
143 ok 2 - Title() get
144 ok 3 - Director() get
145 not ok 4 - Rating() get
147 ok 5 - NumExplodingSheep() get