This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Oops. I need to learn how to use git add.
authorFather Chrysostomos <sprout@cpan.org>
Sun, 14 Nov 2010 05:28:05 +0000 (21:28 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 14 Nov 2010 05:28:05 +0000 (21:28 -0800)
t/mro/isa_aliases.t [new file with mode: 0644]

diff --git a/t/mro/isa_aliases.t b/t/mro/isa_aliases.t
new file mode 100644 (file)
index 0000000..0635efc
--- /dev/null
@@ -0,0 +1,31 @@
+#!./perl
+
+BEGIN { chdir 't'; @INC = '../lib'; require './test.pl' }
+
+plan 8;
+
+@Foogh::ISA = "Bar";
+*Phoogh::ISA = *Foogh::ISA;
+@Foogh::ISA = "Baz";
+
+ok 'Foogh'->isa("Baz"),
+ 'isa after another stash has claimed the @ISA via glob assignment';
+ok 'Phoogh'->isa("Baz"),
+ 'isa on the stash that claimed the @ISA via glob assignment';
+ok !Foogh->isa("Bar"),
+ '!isa when another stash has claimed the @ISA via glob assignment';
+ok !Phoogh->isa("Bar"),
+ '!isa on the stash that claimed the @ISA via glob assignment';
+
+@Foo::ISA = "Bar";
+*Phoo::ISA = \@Foo::ISA;
+@Foo::ISA = "Baz";
+
+ok 'Foo'->isa("Baz"),
+ 'isa after another stash has claimed the @ISA via ref-to-glob assignment';
+ok 'Phoo'->isa("Baz"),
+ 'isa on the stash that claimed the @ISA via ref-to-glob assignment';
+ok !Foo->isa("Bar"),
+ '!isa when another stash has claimed the @ISA via ref-to-glob assignment';
+ok !Phoo->isa("Bar"),
+ '!isa on the stash that claimed the @ISA via ref-to-glob assignment';