diff options
-rw-r--r-- | t/comp/parser.t | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/t/comp/parser.t b/t/comp/parser.t index 0532ab3ba2..439dc71a1d 100644 --- a/t/comp/parser.t +++ b/t/comp/parser.t @@ -9,7 +9,7 @@ BEGIN { } require "./test.pl"; -plan( tests => 58 ); +plan( tests => 59 ); eval '%@x=0;'; like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' ); @@ -203,3 +203,7 @@ eval q{ foo::$bar }; like( $@, qr/Bad name after foo::/, 'Bad name after foo::' ); eval q{ foo''bar }; like( $@, qr/Bad name after foo'/, 'Bad name after foo\'' ); + +# test for ?: context error +eval q{($a ? $x : ($y)) = 5}; +like( $@, qr/Assignment to both a list and a scalar/, 'Assignment to both a list and a scalar' ); |