diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-09-15 22:27:05 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-09-15 22:32:33 -0700 |
commit | a5f4774196bcd82b1f59014c5973ad9610ca913f (patch) | |
tree | 83afd3595d67624f25c9668f52fbeaf65e89e814 /t | |
parent | 1d6bb9ae033c9dd42ee935e1458d658d0cca9183 (diff) | |
download | perl-a5f4774196bcd82b1f59014c5973ad9610ca913f.tar.gz |
Exclude lex sub package name from (caller $n)[3]
Commit ae77754ae caused it to start including the package name. Pre-
viously, lexical subs were reported as ‘(unknown)’.
Now we have more expected output:
$ ./perl -Ilib -XMfeature=:all -e 'my sub x{warn +(caller 0)[3]} x'
x at -e line 1.
Diffstat (limited to 't')
-rw-r--r-- | t/op/lexsub.t | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/t/op/lexsub.t b/t/op/lexsub.t index d2edb79bab..966aa07115 100644 --- a/t/op/lexsub.t +++ b/t/op/lexsub.t @@ -7,7 +7,7 @@ BEGIN { *bar::is = *is; *bar::like = *like; } -plan 135; +plan 137; # -------------------- Errors with feature disabled -------------------- # @@ -380,6 +380,10 @@ like runperl( is runperl(switches => ['-lXMfeature=:all'], prog => 'state sub x {}; undef &x; print defined &x', stderr => 1), "\n", 'undefining state sub'; +{ + state sub x { is +(caller 0)[3], 'x', 'state sub name in caller' } + x +} # -------------------- my -------------------- # @@ -727,6 +731,10 @@ pass "pad taking ownership once more of packagified my-sub"; is runperl(switches => ['-lXMfeature=:all'], prog => 'my sub x {}; undef &x; print defined &x', stderr => 1), "\n", 'undefining my sub'; +{ + my sub x { is +(caller 0)[3], 'x', 'my sub name in caller' } + x +} # -------------------- Interactions (and misc tests) -------------------- # |