summaryrefslogtreecommitdiff
path: root/t/mro
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-09-01 14:47:38 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-09-01 14:47:38 -0700
commit3df5c4b513c5e5c2f25d831f556f2a1c5693ce98 (patch)
treedf8369277985791b3c6d12df55c52c32bcb95b1d /t/mro
parentcbf45e8454c586302a9f324433b3155521872636 (diff)
downloadperl-3df5c4b513c5e5c2f25d831f556f2a1c5693ce98.tar.gz
Teach mro code about null array elements
This is part of ticket #119433. Commit ce0d49f changed AVs to use NULL for nonexistent elements. The mro lookup code was not accounting for that, causing Class::Contract’s tests to crash (and perhaps other modules, too).
Diffstat (limited to 't/mro')
-rw-r--r--t/mro/basic.t8
-rw-r--r--t/mro/isa_c3.t7
2 files changed, 14 insertions, 1 deletions
diff --git a/t/mro/basic.t b/t/mro/basic.t
index 65090732f7..5625b5190e 100644
--- a/t/mro/basic.t
+++ b/t/mro/basic.t
@@ -8,7 +8,7 @@ BEGIN {
@INC = '../lib';
require q(./test.pl);
}
-plan(tests => 60);
+plan(tests => 61);
require mro;
@@ -389,3 +389,9 @@ undef $x; # should use the new DESTROY
is $destroy_output, "new",
'Changes to UNIVERSAL::DESTROY invalidate DESTROY caches';
undef *UNIVERSAL::DESTROY;
+
+{
+ no warnings 'uninitialized';
+ $#_119433::ISA++;
+ pass "no crash when ISA contains nonexistent elements";
+}
diff --git a/t/mro/isa_c3.t b/t/mro/isa_c3.t
index dd129cf442..20ae5f09b4 100644
--- a/t/mro/isa_c3.t
+++ b/t/mro/isa_c3.t
@@ -67,3 +67,10 @@ foreach my $package (qw(klonk urkkk kapow kayo thwacke zzzzzwap whamm)) {
object_ok($ref, $class, $package);
}
}
+
+package _119433 {
+ use mro 'c3';
+ no warnings 'uninitialized';
+ $#_119433::ISA++;
+ ::pass "no crash when ISA contains nonexistent elements";
+}