Convert yadayada.t to test.pl and strict, and fix two diagnostic errors
authorNicholas Clark <nick@ccl4.org>
Sat, 26 Jul 2008 19:51:03 +0000 (19:51 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 26 Jul 2008 19:51:03 +0000 (19:51 +0000)
found in the process.

p4raw-id: //depot/perl@34158

t/op/yadayada.t

index 9f9e903..deca46c 100644 (file)
@@ -1,30 +1,34 @@
 #!./perl
 
-print "1..5\n";
+BEGIN {
+    chdir 't' if -d 't';
+    @INC = '../lib';
+    require './test.pl';
+}
 
-$err = "Unimplemented at $0 line " . ( __LINE__ + 2 ) . ".\n";
+use strict;
+
+plan 5;
+
+my $err = "Unimplemented at $0 line " . ( __LINE__ + 2 ) . ".\n";
 
 eval { ... };
 
-print "not " unless $@ eq $err;
-print "ok 1\n";
-print "# expected: '$err'\n# received: '$@'\n" unless $@ eq $err;
+is $@, $err;
 
 $err = "foo at $0 line " . ( __LINE__ + 2 ) . ".\n";
 
 eval { !!! "foo" };
 
-print "not " unless $@ eq $err;
-print "ok 2\n";
-print "# expected: '$err'\n# received: '$@'\n" unless $@ eq $err;
+is $@, $err;
 
 $err = "Died at $0 line " . ( __LINE__ + 2 ) . ".\n";
 
 eval { !!! };
 
-print "not " unless $@ eq $err;
-print "ok 3\n";
-print "# expected: '$err'\n# received: '$@'\n" unless $@ eq $err;
+is $@, $err;
+
+my $warning;
 
 local $SIG{__WARN__} = sub { $warning = shift };
 
@@ -32,14 +36,10 @@ $err = "bar at $0 line " . ( __LINE__ + 2 ) . ".\n";
 
 eval { ??? "bar" };
 
-print "not " unless $warning eq $err;
-print "ok 4\n";
-print "# expected: '$warning'\n# received: '$warningn" unless $warning eq $err;
+is $warning, $err;
 
 $err = "Warning: something's wrong at $0 line " . ( __LINE__ + 2 ) . ".\n";
 
 eval { ??? };
 
-print "not " unless $warning eq $err;
-print "ok 5\n";
-print "# expected: '$warning'\n# received: '$warningn" unless $warning eq $err;
+is $warning, $err;