This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update to Switch 2.02.
[perl5.git] / t / lib / switch.t
index 3fcd5ca..d1a8af1 100644 (file)
@@ -6,16 +6,8 @@ BEGIN {
 use Carp;
 use Switch qw(__ fallthrough);
 
-print "1..293\n";
-
-my $count = 0;
-sub ok($)
-{
-       $count++;
-       print "line ", (caller)[2], "; " unless $_[0];
-       print "not " unless $_[0];
-       print "ok $count\n";
-}
+my($C,$M);sub ok{$C++;$M.=$_[0]?"ok $C\n":"not ok $C (line ".(caller)[2].")\n"}
+END{print"1..$C\n$M"}
 
 # NON-case THINGS;