summaryrefslogtreecommitdiff
path: root/t/mro
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-11-22 09:25:40 -0800
committerFather Chrysostomos <sprout@cpan.org>2010-11-22 09:25:40 -0800
commit298d65111ee12fde3fed852c9fd487b479c7d919 (patch)
tree545ec5ab1a342ca9273bc24b05ea273fc2f35eb2 /t/mro
parentb58757d5ff9c7545317c6f3c3c7e6aaad3b34de6 (diff)
downloadperl-298d65111ee12fde3fed852c9fd487b479c7d919.tar.gz
Newly-created stashes may need effective names added
Diffstat (limited to 't/mro')
-rw-r--r--t/mro/package_aliases.t21
1 files changed, 20 insertions, 1 deletions
diff --git a/t/mro/package_aliases.t b/t/mro/package_aliases.t
index aefca152ba..bf90429e81 100644
--- a/t/mro/package_aliases.t
+++ b/t/mro/package_aliases.t
@@ -10,7 +10,7 @@ BEGIN {
use strict;
use warnings;
-plan(tests => 24);
+plan(tests => 27);
{
package New;
@@ -138,6 +138,8 @@ for(
#
# This test assigns outer:: to clone::, making clone::inner an alias to
# outer::inner.
+#
+# Then we also run the test again, but without outer::inner
for(
{
name => 'assigning a glob to a glob',
@@ -166,6 +168,23 @@ for(
"ok 1\nok 2\n",
{},
"replacing nonexistent nested packages by $$_{name} updates isa caches";
+
+ # Same test but with the subpackage autovivified after the assignment
+ fresh_perl_is
+ q~
+ @left::ISA = 'outer::inner';
+ @right::ISA = 'clone::inner';
+
+ __code__;
+
+ eval q{package outer::inner};
+
+ print "ok 1", "\n" if left->isa("clone::inner");
+ print "ok 2", "\n" if right->isa("outer::inner");
+ ~ =~ s\__code__\$$_{code}\r,
+ "ok 1\nok 2\n",
+ {},
+ "Giving nonexistent packages multiple effective names by $$_{name}";
}
no warnings; # temporary; there seems to be a scoping bug, as this does not