• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/BerkeleyDB-21/db/perl/BerkeleyDB/t/Test/

Lines Matching defs:ok

25 @EXPORT = qw(ok use_ok require_ok
67 # Various ways to say "ok"
68 ok($this eq $that, $test_name);
86 ok( foo(), $test_name );
93 ok( foo(), $test_name );
122 utilities. Various ways to say "ok" with better diagnostics,
125 C<ok()> function, it doesn't provide good diagnostic output.
236 ok 4
237 not ok 5
238 ok 6
242 ok 4 - basic multi-variable
243 not ok 5 - simple exponential
244 ok 6 - force == mass * acceleration
254 =head2 I'm ok, you're not ok.
256 The basic purpose of this module is to print out either "ok #" or "not
257 ok #" depending on if a given test succeeded or failed. Everything
260 All of the following print "ok" or "not ok" depending on if the test
266 =item B<ok>
268 ok($this eq $that, $test_name);
276 ok( $exp{9} == 81, 'simple exponential' );
277 ok( Film->can('db_Main'), 'set_db()' );
278 ok( $p->tests == 4, 'saw tests' );
279 ok( !grep !defined $_, @items, 'items populated' );
281 (Mnemonic: "This is ok.")
288 Should an ok() fail, it will produce some diagnostics:
290 not ok 18 - sufficient mucus
293 This is actually Test::Simple's ok() routine.
297 sub ok ($;$) {
299 $Test->ok($test, $name);
309 Similar to ok(), is() and isnt() compare their two arguments
321 ok( ultimate_answer() eq 42, "Meaning of Life" );
322 ok( $foo ne '', "Got some foo" );
326 So why use these? They produce better diagnostics on failure. ok()
336 not ok 17 - Is foo the same as bar?
343 You are encouraged to use is() and isnt() over ok() where possible,
352 In these cases, use ok().
354 ok( exists $brooklyn{tree}, 'A tree grows in Brooklyn' );
376 Similar to ok(), like() matches $this against the regex C<qr/that/>.
384 ok( $this =~ /that/, 'this is like that');
397 Its advantages over ok() are similar to that of is() and isnt(). Better
425 Halfway between ok() and is() lies cmp_ok(). This allows you to
428 # ok( $this eq $that );
431 # ok( $this == $that );
434 # ok( $this && $that );
438 Its advantage over ok() is when the test fails you'll know what $this
441 not ok 1
471 ok( Foo->can('this') &&
493 my $ok = $Test->ok( 0, "$class->can(...)" );
495 return $ok;
509 my $ok = $Test->ok( !@nok, $name );
513 return $ok;
531 ok( defined $obj && $obj->isa('Some::Module') );
584 my $ok;
586 $ok = $Test->ok( 0, $name );
590 $ok = $Test->ok( 1, $name );
593 return $ok;
606 wedge into an ok(). In this case, you can simply use pass() (to
607 declare the test ok) or fail (for not ok). They are synonyms for
608 ok(1) and ok(0).
615 $Test->ok(1, @_);
619 $Test->ok(0, @_);
643 ok( grep(/foo/, @users), "There's a foo user" ) or
648 not ok 42 - There's a foo user
652 You might remember C<ok() or diag()> with the mnemonic C<open() or
677 You usually want to test if the module you're testing loads ok, rather
689 happened ok. It's recommended that you run use_ok() inside a BEGIN
746 my $ok = $Test->ok( !$@, "use $module;" );
748 unless( $ok ) {
759 return $ok;
786 my $ok = $Test->ok( !$@, "require $module;" );
788 unless( $ok ) {
797 return $ok;
856 code I<won't be run at all>. Test::More will output special ok's
916 they are "todo". Test::Harness will interpret failures as being ok.
1025 my $ok;
1027 $ok = 0;
1030 $ok = $Test->is_eq($this, $that, $name);
1036 $ok = $Test->ok(1, $name);
1039 $ok = $Test->ok(0, $name);
1040 $ok = $Test->diag(_format_stack(@Data_Stack));
1044 return $ok;
1135 my $ok = 1;
1142 $ok = _deep_check($e1,$e2);
1143 pop @Data_Stack if $ok;
1145 last unless $ok;
1148 return $ok;
1153 my $ok = 0;
1165 $ok = 0;
1168 $ok = 0;
1171 $ok = 1;
1179 $ok = 0;
1182 $ok = _eq_array($e1, $e2);
1185 $ok = _eq_hash($e1, $e2);
1189 $ok = _deep_check($$e1, $$e2);
1190 pop @Data_Stack if $ok;
1194 $ok = _deep_check($$e1, $$e2);
1195 pop @Data_Stack if $ok;
1200 return $ok;
1236 my $ok = 1;
1243 $ok = _deep_check($e1, $e2);
1244 pop @Data_Stack if $ok;
1246 last unless $ok;
1249 return $ok;
1359 I<before> Test::More is loaded. This is ok:
1387 written my own ok() routines. This module exists because I can't