diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-11-28 13:46:07 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-11-29 09:11:31 -0800 |
commit | 3d460042b1251a4b5e3b583fa6be358554dd3bcc (patch) | |
tree | b030f3a2e7d42864f23b1fb1ca7c78e5da7dc1b9 /t/mro | |
parent | 959f7ad7c12f768f896b4dd48b5b7f41b6b087b5 (diff) | |
download | perl-3d460042b1251a4b5e3b583fa6be358554dd3bcc.tar.gz |
Fix two local *ISA bugs
These are regressions from 5.8.
local *ISA was not updating isa caches. local *ISA = [] was updating
caches, but scope unwinding was not.
Both save_gp and leave_scope/SAVEt_GP need to check whether the glob
is named ISA and call mro_isa_changed_in if appropriate.
Diffstat (limited to 't/mro')
-rw-r--r-- | t/mro/basic.t | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/t/mro/basic.t b/t/mro/basic.t index cc1386c5f4..ab34fc2567 100644 --- a/t/mro/basic.t +++ b/t/mro/basic.t @@ -3,7 +3,7 @@ use strict; use warnings; -BEGIN { require q(./test.pl); } plan(tests => 55); +BEGIN { require q(./test.pl); } plan(tests => 59); require mro; @@ -353,3 +353,20 @@ is(eval { MRO_N->testfunc() }, 123); eval { local *Detached::method }; is $@, "", 'localising gv-with-cv belonging to detached package'; } + +{ + # *ISA localisation + @il::ISA = "ilsuper"; + sub ilsuper::can { "puree" } + sub il::tomatoes; + { + local *il::ISA; + is +il->can("tomatoes"), \&il::tomatoes, 'local *ISA'; + } + is "il"->can("tomatoes"), "puree", 'local *ISA unwinding'; + { + local *il::ISA = []; + is +il->can("tomatoes"), \&il::tomatoes, 'local *ISA = []'; + } + is "il"->can("tomatoes"), "puree", 'local *ISA=[] unwinding'; +} |