diff options
Diffstat (limited to 't')
-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"); |