diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-09-16 09:43:31 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-09-16 10:03:57 -0700 |
commit | dffc502431a92571665171f2d25d28f95339feec (patch) | |
tree | e3f5ced37cd29cf0f22995937ed235bb842b1e7d /t/op/lexsub.t | |
parent | 1402e1ebcb8d82c4d6423a1d27f1f5b6791da0a8 (diff) | |
download | perl-dffc502431a92571665171f2d25d28f95339feec.tar.gz |
Make ‘No comma allowed’ respect lex subs
$ ./perl -lIlib -XMfeature=:all -e 'sub foo {} print foo,bar'
bar
$ ./perl -lIlib -XMfeature=:all -e 'state sub foo {} print foo,bar'
No comma allowed after filehandle at -e line 1.
This commit makes the latter behave like the former.
Diffstat (limited to 't/op/lexsub.t')
-rw-r--r-- | t/op/lexsub.t | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/t/op/lexsub.t b/t/op/lexsub.t index 7fedbf9fa3..91bb15f4d3 100644 --- a/t/op/lexsub.t +++ b/t/op/lexsub.t @@ -7,7 +7,7 @@ BEGIN { *bar::is = *is; *bar::like = *like; } -plan 139; +plan 141; # -------------------- Errors with feature disabled -------------------- # @@ -391,6 +391,12 @@ sub _cmp { $a cmp $b } is join(" ", sort _cmp split //, 'lexsub'), 'x u s l e b', 'sort state_sub LIST' } +{ + state sub handel { "" } + print handel, "ok ", curr_test(), + " - no 'No comma allowed' after state sub\n"; + curr_test(curr_test()+1); +} # -------------------- my -------------------- # @@ -748,6 +754,11 @@ is runperl(switches => ['-lXMfeature=:all'], is join(" ", sort _cmp split //, 'lexsub'), 'x u s l e b', 'sort my_sub LIST' } +{ + my sub handel { "" } + print handel,"ok ",curr_test()," - no 'No comma allowed' after my sub\n"; + curr_test(curr_test()+1); +} # -------------------- Interactions (and misc tests) -------------------- # |