diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-07-02 21:26:13 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-09-15 22:44:54 -0700 |
commit | 4b473a5a056427bc93ffb46dbb873c9e6ec5287f (patch) | |
tree | e6603cbb600c5dbac82436bb013ed6a611e2877d /t/cmd | |
parent | 945534e1d3d80e5758511e1e2700775217d07796 (diff) | |
download | perl-4b473a5a056427bc93ffb46dbb873c9e6ec5287f.tar.gz |
Make do sub() respect our declarations
Diffstat (limited to 't/cmd')
-rw-r--r-- | t/cmd/lexsub.t | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/t/cmd/lexsub.t b/t/cmd/lexsub.t index 0732678307..02bb71c81a 100644 --- a/t/cmd/lexsub.t +++ b/t/cmd/lexsub.t @@ -2,25 +2,30 @@ BEGIN { chdir 't'; + @INC = '../lib'; require './test.pl'; *bar::is = *is; } -plan 13; +no warnings 'deprecated'; +plan 19; { our sub foo { 42 } is foo, 42, 'calling our sub from same package'; is &foo, 42, 'calling our sub from same package (amper)'; + is do foo(), 42, 'calling our sub from same package (do)'; package bar; sub bar::foo { 43 } { local $::TODO = ' '; is foo, 42, 'calling our sub from another package'; } is &foo, 42, 'calling our sub from another package (amper)'; + is do foo(), 42, 'calling our sub from another package (do)'; } package bar; is foo, 43, 'our sub falling out of scope'; is &foo, 43, 'our sub falling out of scope (called via amper)'; +is do foo(), 43, 'our sub falling out of scope (called via amper)'; package main; { sub bar::a { 43 } @@ -29,6 +34,7 @@ package main; package bar; is a, 43, 'our sub invisible inside itself'; is &a, 43, 'our sub invisible inside itself (called via amper)'; + is do a(), 43, 'our sub invisible inside itself (called via do)'; } 42 } @@ -42,6 +48,7 @@ package main; is b, 42, 'our sub visible inside itself after decl'; } is &b, 42, 'our sub visible inside itself after decl (amper)'; + is do b(), 42, 'our sub visible inside itself after decl (do)'; } 42 } @@ -56,6 +63,7 @@ sub bar::c { 43 } is c, 42, 'our sub foo; makes lex alias for existing sub'; } is &c, 42, 'our sub foo; makes lex alias for existing sub (amper)'; + is do c(), 42, 'our sub foo; makes lex alias for existing sub (do)'; } { our sub d; |