From: Rafael Garcia-Suarez Date: Fri, 5 Apr 2002 20:47:22 +0000 (+0000) Subject: Some tests were failing silently instead of saying "not ok" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=13fc5c1401935d87cec6dbb2c2daaa4a99b6c7cd;p=p5sagit%2Fp5-mst-13.2.git Some tests were failing silently instead of saying "not ok" p4raw-id: //depot/perl@15754 --- diff --git a/t/comp/proto.t b/t/comp/proto.t index e020be7..e317a94 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';