From: Bram Date: Sat, 25 Jul 2009 20:11:55 +0000 (+0200) Subject: Tests for commit 1375cf1cf2085f851bb176047d5e60248542f555 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2788925507d099c7b1e9382ad2ddc4f3d692de28;p=p5sagit%2Fp5-mst-13.2.git Tests for commit 1375cf1cf2085f851bb176047d5e60248542f555 --- diff --git a/t/op/universal.t b/t/op/universal.t index a1ff975..a24d7aa 100644 --- a/t/op/universal.t +++ b/t/op/universal.t @@ -10,7 +10,7 @@ BEGIN { require "./test.pl"; } -plan tests => 117; +plan tests => 123; $a = {}; bless $a, "Bob"; @@ -253,3 +253,57 @@ use warnings "deprecated"; like($m, qr/^UNIVERSAL->import is deprecated/, "deprecation warning for UNIVERSAL->import"); } + +# Test: [perl #66112]: change @ISA inside sub isa +{ + package RT66112::A; + + package RT66112::B; + + sub isa { + my $self = shift; + @ISA = qw/RT66112::A/; + return $self->SUPER::isa(@_); + } + + package RT66112::C; + + package RT66112::D; + + sub isa { + my $self = shift; + @RT66112::E::ISA = qw/RT66112::A/; + return $self->SUPER::isa(@_); + } + + package RT66112::E; + + package main; + + @RT66112::B::ISA = qw//; + @RT66112::C::ISA = qw/RT66112::B/; + @RT66112::T1::ISA = qw/RT66112::C/; + ok(RT66112::T1->isa('RT66112::C'), "modify \@ISA in isa (RT66112::T1 isa RT66112::C)"); + + @RT66112::B::ISA = qw//; + @RT66112::C::ISA = qw/RT66112::B/; + @RT66112::T2::ISA = qw/RT66112::C/; + ok(RT66112::T2->isa('RT66112::B'), "modify \@ISA in isa (RT66112::T2 isa RT66112::B)"); + + @RT66112::B::ISA = qw//; + @RT66112::C::ISA = qw/RT66112::B/; + @RT66112::T3::ISA = qw/RT66112::C/; + ok(RT66112::T3->isa('RT66112::A'), "modify \@ISA in isa (RT66112::T3 isa RT66112::A)"); + + @RT66112::E::ISA = qw/RT66112::D/; + @RT66112::T4::ISA = qw/RT66112::E/; + ok(RT66112::T4->isa('RT66112::E'), "modify \@ISA in isa (RT66112::T4 isa RT66112::E)"); + + @RT66112::E::ISA = qw/RT66112::D/; + @RT66112::T5::ISA = qw/RT66112::E/; + ok(! RT66112::T5->isa('RT66112::D'), "modify \@ISA in isa (RT66112::T5 not isa RT66112::D)"); + + @RT66112::E::ISA = qw/RT66112::D/; + @RT66112::T6::ISA = qw/RT66112::E/; + ok(RT66112::T6->isa('RT66112::A'), "modify \@ISA in isa (RT66112::T6 isa RT66112::A)"); +}