Fix bug 32294 - index()/rindex() ignore UTF8 flag
[p5sagit/p5-mst-13.2.git] / t / comp / parser.t
index c68f7ab..d784373 100644 (file)
@@ -9,7 +9,7 @@ BEGIN {
 }
 
 require "./test.pl";
-plan( tests => 41 );
+plan( tests => 47 );
 
 eval '%@x=0;';
 like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' );
@@ -135,3 +135,36 @@ EOF
        '-F calls the F function'
     );
 }
+
+# Bug #24762
+{
+    eval q{ *foo{CODE} ? 1 : 0 };
+    is( $@, '', "glob subscript in conditional" );
+}
+
+# Bug #25824
+{
+    eval q{ sub f { @a=@b=@c;  {use} } };
+    like( $@, qr/syntax error/, "use without body" );
+}
+
+# Bug #27024
+{
+    # this used to segfault (because $[=1 is optimized away to a null block)
+    my $x;
+    $[ = 1 while $x;
+    pass();
+    $[ = 0; # restore the original value for less side-effects
+}
+
+# [perl #2738] perl segfautls on input
+{
+    eval q{ sub _ <> {} };
+    like($@, qr/Illegal declaration of subroutine main::_/, "readline operator as prototype");
+
+    eval q{ $s = sub <> {} };
+    like($@, qr/Illegal declaration of anonymous subroutine/, "readline operator as prototype");
+
+    eval q{ sub _ __FILE__ {} };
+    like($@, qr/Illegal declaration of subroutine main::_/, "__FILE__ as prototype");
+}