diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-10-15 11:12:31 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-10-15 11:12:31 +0000 |
commit | 3cf7b4c446ec2eb4fa0902195a9812fc4f83df28 (patch) | |
tree | 8b05014144619ca2aca2412986c5a06399902cb4 /t/comp | |
parent | 8be5f608f6696ee966fa295d23ecd0c1c2220447 (diff) | |
download | perl-3cf7b4c446ec2eb4fa0902195a9812fc4f83df28.tar.gz |
Fix bug [perl #24212] : improper error recovery in the
tokenizer after an unknown filetest operator.
p4raw-id: //depot/perl@21452
Diffstat (limited to 't/comp')
-rw-r--r-- | t/comp/parser.t | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/t/comp/parser.t b/t/comp/parser.t index 899f8674ee..ca191c2de0 100644 --- a/t/comp/parser.t +++ b/t/comp/parser.t @@ -9,7 +9,7 @@ BEGIN { } require "./test.pl"; -plan( tests => 39 ); +plan( tests => 41 ); eval '%@x=0;'; like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' ); @@ -123,3 +123,15 @@ EOF ok($@ eq '', "eval $eval"); is(ref $result, $expect ? 'HASH' : '', $eval); } + +# Bug #24212 +{ + local $SIG{__WARN__} = sub { }; # silence mandatory warning + eval q{ my $x = -F 1; }; + like( $@, qr/syntax error .* near "F 1"/, "unknown filetest operators" ); + is( + eval q{ sub F { 42 } -F 1 }, + '-42', + '-F calls the F function' + ); +} |