Add tests for the C<my $x if foo> deprecation, and change the
[p5sagit/p5-mst-13.2.git] / t / comp / parser.t
index ca191c2..e59fec6 100644 (file)
@@ -9,7 +9,7 @@ BEGIN {
 }
 
 require "./test.pl";
-plan( tests => 41 );
+plan( tests => 43 );
 
 eval '%@x=0;';
 like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' );
@@ -128,10 +128,22 @@ EOF
 {
     local $SIG{__WARN__} = sub { }; # silence mandatory warning
     eval q{ my $x = -F 1; };
-    like( $@, qr/syntax error .* near "F 1"/, "unknown filetest operators" );
+    like( $@, qr/(?:syntax|parse) error .* near "F 1"/, "unknown filetest operators" );
     is(
         eval q{ sub F { 42 } -F 1 },
        '-42',
        '-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" );
+}