Pack Patch (was Re: 5.002 - pack/unpack does not do "I" right)
[p5sagit/p5-mst-13.2.git] / t / op / eval.t
old mode 100644 (file)
new mode 100755 (executable)
index 464162c..6d0a67b
@@ -1,8 +1,8 @@
 #!./perl
 
-# $Header: eval.t,v 4.0 91/03/20 01:52:20 lwall Locked $
+# $RCSfile: eval.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:48 $
 
-print "1..10\n";
+print "1..16\n";
 
 eval 'print "ok 1\n";';
 
@@ -15,7 +15,7 @@ eval "\$foo\n    = # this is a comment\n'ok 4\n';";
 print $foo;
 
 print eval '
-$foo =';               # this tests for a call through yyerror()
+$foo =;';              # this tests for a call through yyerror()
 if ($@ =~ /line 2/) {print "ok 5\n";} else {print "not ok 5\n";}
 
 print eval '$foo = /'; # this tests for a call through fatal()
@@ -40,3 +40,18 @@ print try 'print "ok 10\n"; unlink "Op.eval";',"\n";
 close try;
 
 do 'Op.eval'; print $@;
+
+# Test the singlequoted eval optimizer
+
+$i = 11;
+for (1..3) {
+    eval 'print "ok ", $i++, "\n"';
+}
+
+eval {
+    print "ok 14\n";
+    die "ok 16\n";
+    1;
+} || print "ok 15\n$@";
+
+