diff options
author | Gerard Goossen <gerard@ggoossen.net> | 2009-12-08 12:42:58 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-12-08 16:12:31 +0100 |
commit | f6435df36c4167f97876032948ee21a446b75f27 (patch) | |
tree | 4a11f4276858e1f9734e2e7d6ed7f1c624f1c654 /t | |
parent | 13290fcd82823e130109fca5199c99fb886e29eb (diff) | |
download | perl-f6435df36c4167f97876032948ee21a446b75f27.tar.gz |
proper error on "grep $x (1,2,3)". Solves [perl #37314]
Diffstat (limited to 't')
-rw-r--r-- | t/op/grep.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/grep.t b/t/op/grep.t index d7fe515a4b..456b6c5c17 100644 --- a/t/op/grep.t +++ b/t/op/grep.t @@ -10,7 +10,7 @@ BEGIN { } require "test.pl"; -plan( tests => 60 ); +plan( tests => 61 ); { my @lol = ([qw(a b c)], [], [qw(1 2 3)]); @@ -207,3 +207,10 @@ plan( tests => 60 ); my @empty = map { while (1) {} } (); cmp_ok("@empty", 'eq', '', 'staying alive'); } + +{ + my $x; + eval 'grep $x (1,2,3);'; + like($@, qr/Missing comma after first argument to grep function/, + "proper error on variable as block. [perl #37314]"); +} |