diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2002-04-05 20:47:22 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2002-04-05 20:47:22 +0000 |
commit | 13fc5c1401935d87cec6dbb2c2daaa4a99b6c7cd (patch) | |
tree | 9fdd234bc3ef24f8ebb2d9a6f0160367676afdae /t | |
parent | 41398221880617e9d45dc32b0700dbe7db16e158 (diff) | |
download | perl-13fc5c1401935d87cec6dbb2c2daaa4a99b6c7cd.tar.gz |
Some tests were failing silently instead of saying "not ok"
p4raw-id: //depot/perl@15754
Diffstat (limited to 't')
-rwxr-xr-x | t/comp/proto.t | 127 |
1 files changed, 92 insertions, 35 deletions
diff --git a/t/comp/proto.t b/t/comp/proto.t index e020be7536..e317a94b2a 100755 --- a/t/comp/proto.t +++ b/t/comp/proto.t @@ -441,44 +441,101 @@ sub star2 (**&) { &{$_[2]} } sub BAR { "quux" } sub Bar::BAZ { "quuz" } my $star = 'FOO'; -star FOO, sub { print "ok $i\n" if $_[0] eq 'FOO' }; $i++; -star(FOO, sub { print "ok $i\n" if $_[0] eq 'FOO' }); $i++; -star "FOO", sub { print "ok $i\n" if $_[0] eq 'FOO' }; $i++; -star("FOO", sub { print "ok $i\n" if $_[0] eq 'FOO' }); $i++; -star $star, sub { print "ok $i\n" if $_[0] eq 'FOO' }; $i++; -star($star, sub { print "ok $i\n" if $_[0] eq 'FOO' }); $i++; -star *FOO, sub { print "ok $i\n" if $_[0] eq \*FOO }; $i++; -star(*FOO, sub { print "ok $i\n" if $_[0] eq \*FOO }); $i++; -star \*FOO, sub { print "ok $i\n" if $_[0] eq \*FOO }; $i++; -star(\*FOO, sub { print "ok $i\n" if $_[0] eq \*FOO }); $i++; -star2 FOO, BAR, sub { print "ok $i\n" - if $_[0] eq 'FOO' and $_[1] eq 'BAR' }; $i++; -star2(Bar::BAZ, FOO, sub { print "ok $i\n" - if $_[0] eq 'Bar::BAZ' and $_[1] eq 'FOO' }); $i++; -star2 BAR(), FOO, sub { print "ok $i\n" - if $_[0] eq 'quux' and $_[1] eq 'FOO' }; $i++; -star2(FOO, BAR(), sub { print "ok $i\n" - if $_[0] eq 'FOO' and $_[1] eq 'quux' }); $i++; -star2 "FOO", "BAR", sub { print "ok $i\n" - if $_[0] eq 'FOO' and $_[1] eq 'BAR' }; $i++; -star2("FOO", "BAR", sub { print "ok $i\n" - if $_[0] eq 'FOO' and $_[1] eq 'BAR' }); $i++; -star2 $star, $star, sub { print "ok $i\n" - if $_[0] eq 'FOO' and $_[1] eq 'FOO' }; $i++; -star2($star, $star, sub { print "ok $i\n" - if $_[0] eq 'FOO' and $_[1] eq 'FOO' }); $i++; -star2 *FOO, *BAR, sub { print "ok $i\n" - if $_[0] eq \*FOO and $_[1] eq \*BAR }; $i++; -star2(*FOO, *BAR, sub { print "ok $i\n" - if $_[0] eq \*FOO and $_[1] eq \*BAR }); $i++; -star2 \*FOO, \*BAR, sub { no strict 'refs'; print "ok $i\n" - if $_[0] eq \*{'FOO'} and $_[1] eq \*{'BAR'} }; $i++; -star2(\*FOO, \*BAR, sub { no strict 'refs'; print "ok $i\n" - if $_[0] eq \*{'FOO'} and $_[1] eq \*{'BAR'} }); $i++; +star FOO, sub { + print "not " unless $_[0] eq 'FOO'; + print "ok $i - star FOO\n"; +}; $i++; +star(FOO, sub { + print "not " unless $_[0] eq 'FOO'; + print "ok $i - star(FOO)\n"; + }); $i++; +star "FOO", sub { + print "not " unless $_[0] eq 'FOO'; + print qq/ok $i - star "FOO"\n/; +}; $i++; +star("FOO", sub { + print "not " unless $_[0] eq 'FOO'; + print qq/ok $i - star("FOO")\n/; + }); $i++; +star $star, sub { + print "not " unless $_[0] eq 'FOO'; + print "ok $i - star \$star\n"; +}; $i++; +star($star, sub { + print "not " unless $_[0] eq 'FOO'; + print "ok $i - star(\$star)\n"; + }); $i++; +star *FOO, sub { + print "not " unless $_[0] eq \*FOO; + print "ok $i - star *FOO\n"; +}; $i++; +star(*FOO, sub { + print "not " unless $_[0] eq \*FOO; + print "ok $i - star(*FOO)\n"; + }); $i++; +star \*FOO, sub { + print "not " unless $_[0] eq \*FOO; + print "ok $i - star \\*FOO\n"; +}; $i++; +star(\*FOO, sub { + print "not " unless $_[0] eq \*FOO; + print "ok $i - star(\\*FOO)\n"; + }); $i++; +star2 FOO, BAR, sub { + print "not " unless $_[0] eq 'FOO' and $_[1] eq 'BAR'; + print "ok $i - star2 FOO, BAR\n"; +}; $i++; +star2(Bar::BAZ, FOO, sub { + print "not " unless $_[0] eq 'Bar::BAZ' and $_[1] eq 'FOO'; + print "ok $i - star2(Bar::BAZ, FOO)\n" + }); $i++; +star2 BAR(), FOO, sub { + print "not " unless $_[0] eq 'quux' and $_[1] eq 'FOO'; + print "ok $i - star2 BAR(), FOO\n" +}; $i++; +star2(FOO, BAR(), sub { + print "not " unless $_[0] eq 'FOO' and $_[1] eq 'quux'; + print "ok $i - star2(FOO, BAR())\n"; + }); $i++; +star2 "FOO", "BAR", sub { + print "not " unless $_[0] eq 'FOO' and $_[1] eq 'BAR'; + print qq/ok $i - star2 "FOO", "BAR"\n/; +}; $i++; +star2("FOO", "BAR", sub { + print "not " unless $_[0] eq 'FOO' and $_[1] eq 'BAR'; + print qq/ok $i - star2("FOO", "BAR")\n/; + }); $i++; +star2 $star, $star, sub { + print "not " unless $_[0] eq 'FOO' and $_[1] eq 'FOO'; + print "ok $i - star2 \$star, \$star\n"; +}; $i++; +star2($star, $star, sub { + print "not " unless $_[0] eq 'FOO' and $_[1] eq 'FOO'; + print "ok $i - star2(\$star, \$star)\n"; + }); $i++; +star2 *FOO, *BAR, sub { + print "not " unless $_[0] eq \*FOO and $_[1] eq \*BAR; + print "ok $i - star2 *FOO, *BAR\n"; +}; $i++; +star2(*FOO, *BAR, sub { + print "not " unless $_[0] eq \*FOO and $_[1] eq \*BAR; + print "ok $i - star2(*FOO, *BAR)\n"; + }); $i++; +star2 \*FOO, \*BAR, sub { + no strict 'refs'; + print "not " unless $_[0] eq \*{'FOO'} and $_[1] eq \*{'BAR'}; + print "ok $i - star2 \*FOO, \*BAR\n"; +}; $i++; +star2(\*FOO, \*BAR, sub { + no strict 'refs'; + print "not " unless $_[0] eq \*{'FOO'} and $_[1] eq \*{'BAR'}; + print "ok $i - star2(\*FOO, \*BAR)\n"; + }); $i++; # test scalarref prototype sub sreftest (\$$) { - print "ok $_[1]\n" if ref $_[0]; + print "not " unless ref $_[0]; + print "ok $_[1] - sreftest\n"; } { no strict 'vars'; |