Lines Matching defs:ok

14 sub ok {
15 my($ok, $info, $todo) = @_;
18 printf "%s $test%s\n", $ok ? "ok" : "not ok",
21 unless( $ok ) {
27 return $ok;
33 printf "ok $test # skipped%s\n", defined $reason ? ": $reason" : '';
59 if ($Is_MSWin32) { ok `set FOO` =~ /^(?:FOO=)?hi there$/; }
60 elsif ($Is_MacOS) { ok "1 # skipped", 1; }
61 elsif ($Is_VMS) { ok `write sys\$output f\$trnlnm("FOO")` eq "hi there\n"; }
62 else { ok `echo \$FOO` eq "hi there\n"; }
67 ok $!, $!;
86 $SIG{"INT"} = "IGNORE"; kill "INT",$$; sleep 1; print "ok 4\n";
87 $SIG{"INT"} = "DEFAULT"; kill "INT",$$; sleep 1; print "not ok 4\n";
91 print "ok 3\n";
94 print "not ok 3 ($x @_)\n";
124 print "ok 5\n";
130 print $? & 0xFF ? "ok 6$todo\n" : "not ok 6$todo\n";
138 ok join(':',@val1) eq join(':',@val2);
139 ok @val1 > 1;
143 ok $` eq 'foo', $`;
144 ok $& eq 'bar', $&;
145 ok $' eq 'baz', $';
146 ok $+ eq 'a', $+;
150 ok "@a" eq "foo bar baz", "@a";
153 ok "@a" eq "foo,bar,baz", "@a";
159 ok((keys %h)[0] eq "foo\034bar", (keys %h)[0]);
164 ok((keys %h)[0] eq 'fooxbar', (keys %h)[0]);
173 ok $? == 0, $?;
175 ok $? != 0, $?;
179 ok $@ eq "foo\n", $@;
181 ok $$ > 0, $$;
183 ok $@ =~ /^Modification of a read-only value attempted/;
242 ok open(SCRIPT, ">$script"), $!;
243 ok print(SCRIPT $headmaybe . <<EOB . <<'EOF' . $tailmaybe), $!;
248 ok close(SCRIPT), $!;
249 ok chmod(0755, $script), $!;
255 ok((($Is_MSWin32 || $Is_os2) ? uc($_) eq uc($s1) : $_ eq $s1), " :$_:!=:$s1:");
259 ok((($Is_MSWin32 || $Is_os2) ? uc($_) eq uc($s1) : $_ eq $s1), " :$_:!=:$s1: after `$perl $script`");
260 ok unlink($script), $!;
264 ok $] >= 5.00319, $];
265 ok $^O;
266 ok $^T > 850000000, $^T;
281 ok ($Is_MSWin32 ? (`set foo 2>NUL` eq "")
289 ok ($Is_MSWin32 ? (`set __NoNeSuCh` =~ /^(?:__NoNeSuCh=)?foo$/)
295 ok($me eq $0, 'altering $0 is effective (testing with /proc/)');
310 ok(!$ps # we allow that something goes wrong with the ps command
329 my $ok = 1;
331 local $SIG{'__WARN__'} = sub { $ok = 0; $warn = join '', @_; };
333 ok($ok, $warn, $Is_VMS ? "'\$!=undef' does throw a warning" : '');
342 ok (scalar(keys(%ENV)) == 1);
343 ok exists($ENV{'FOo'});
344 ok (delete($ENV{'foO'}) eq 'baz');
345 ok (scalar(keys(%ENV)) == 0);
358 ok !defined %Errno::;
362 ok scalar eval q{
378 ok ${"!"}{ENOENT};
381 ok $^S == 0 && defined $^S;
382 eval { ok $^S == 1 };
383 eval " BEGIN { ok ! defined \$^S } ";
384 ok $^S == 0 && defined $^S;
386 ok ${^TAINT} == 0;
388 ok ${^TAINT} == 0;
394 ok "@-" eq "0 0 2 7";
395 ok "@+" eq "10 1 6 10";
399 my $ok = 0;
404 $ok = $\ eq 2;
406 ok $ok;
407 $ok = 0;
410 $ok = "a$\b" eq "aa\0bb";
412 ok $ok;
424 ok( $x eq "@y", "return a magic array ($x) vs (@y)" );