add test that eval undef clears $@
authorDave Mitchell <davem@fdisolutions.com>
Thu, 2 Nov 2006 17:36:33 +0000 (17:36 +0000)
committerDave Mitchell <davem@fdisolutions.com>
Thu, 2 Nov 2006 17:36:33 +0000 (17:36 +0000)
p4raw-id: //depot/perl@29194

t/op/eval.t

index d64504c..7ab73ed 100755 (executable)
@@ -5,7 +5,7 @@ BEGIN {
     @INC = '../lib';
 }
 
-print "1..92\n";
+print "1..93\n";
 
 eval 'print "ok 1\n";';
 
@@ -449,3 +449,12 @@ stderr => 1);
 print "not " unless $got eq "ok\n";
 print "ok $test - eval and last\n"; $test++;
 
+# eval undef should be the same as eval "" barring any warnings
+
+{
+    local $@ = "foo";
+    eval undef;
+    print "not " unless $@ eq "";
+    print "ok $test # eval unef \n"; $test++;
+}
+