diff options
author | Tony Cook <tony@develop-help.com> | 2010-02-18 20:59:33 +1100 |
---|---|---|
committer | Jesse Vincent <jesse@bestpractical.com> | 2010-02-18 08:52:18 -0800 |
commit | d851b1227a19f97a94b5fca3f346e709d37be33b (patch) | |
tree | cba17e61b405f35c625edbd9e603acec3acf1f65 /t/mro | |
parent | 566a4373528224e69d78518db4305047a2cbe53f (diff) | |
download | perl-d851b1227a19f97a94b5fca3f346e709d37be33b.tar.gz |
rt #72866 - add magic to arrayrefs assigned to *Foo::ISA
The fix for rt #60220 (26d68d86) updated the isa cache when an
arrayref was assigned to some *ISA, but didn't add the magic to the
new @ISA to catch any further updates to it. Add the magic, and
tests.
Diffstat (limited to 't/mro')
-rw-r--r-- | t/mro/basic.t | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/t/mro/basic.t b/t/mro/basic.t index a4d3015035..fbd3a6dd76 100644 --- a/t/mro/basic.t +++ b/t/mro/basic.t @@ -3,7 +3,7 @@ use strict; use warnings; -require q(./test.pl); plan(tests => 44); +require q(./test.pl); plan(tests => 48); require mro; @@ -250,6 +250,28 @@ is(eval { MRO_N->testfunc() }, 123); } { + # assigning @ISA via arrayref then modifying it RT 72866 + { + package Q1; + sub foo { } + + package Q2; + sub bar { } + + package Q3; + } + push @Q3::ISA, "Q1"; + can_ok("Q3", "foo"); + *Q3::ISA = []; + push @Q3::ISA, "Q1"; + can_ok("Q3", "foo"); + *Q3::ISA = []; + push @Q3::ISA, "Q2"; + can_ok("Q3", "bar"); + ok(!Q3->can("foo"), "can't call foo method any longer"); +} + +{ # test mro::method_changed_in my $count = mro::get_pkg_gen("MRO_A"); mro::method_changed_in("MRO_A"); |