Lines Matching defs:ok
12 our @EXPORT = qw(ok);
24 ok( $foo eq $bar, 'foo is bar' );
36 The basic unit of Perl testing is the ok. For each thing you want to
37 test your program will print out an "ok" or "not ok" to indicate pass
38 or fail. You do this with the ok() function (see below).
52 =item B<ok>
54 ok( $foo eq $bar, $name );
55 ok( $foo eq $bar );
57 ok() is given an expression (in this case C<$foo eq $bar>). If it's
60 ok() prints out either "ok" or "not ok" along with a test number (it
63 # This produces "ok 1 - Hell not yet frozen over" (or not ok)
64 ok( get_temperature($hell) > 0, 'Hell not yet frozen over' );
66 If you provide a $name, that will be printed along with the "ok/not
67 ok" to make it easier to find your test when if fails (just search for
73 ok( @stuff, 'I have some stuff' );
79 sub ok ($;$) { ## no critic (Subroutines::ProhibitSubroutinePrototypes)
80 return $CLASS->builder->ok(@_);
124 ok( defined($btaste) && ref $btaste eq 'Film, 'new() works' );
126 ok( $btaste->Title eq 'Bad Taste', 'Title() get' );
127 ok( $btaste->Director eq 'Peter Jackson', 'Director() get' );
128 ok( $btaste->Rating eq 'R', 'Rating() get' );
129 ok( $btaste->NumExplodingSheep == 1, 'NumExplodingSheep() get' );
134 ok 1 - new() works
135 ok 2 - Title() get
136 ok 3 - Director() get
137 not ok 4 - Rating() get
140 ok 5 - NumExplodingSheep() get