This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta: Add the entry about text-mode source from 270ca14
[perl5.git] / t / mro / isa_aliases.t
CommitLineData
e1603486
FC
1#!./perl
2
3BEGIN { chdir 't'; @INC = '../lib'; require './test.pl' }
4
a5dba54a 5plan 12;
e1603486
FC
6
7@Foogh::ISA = "Bar";
8*Phoogh::ISA = *Foogh::ISA;
9@Foogh::ISA = "Baz";
10
11ok 'Foogh'->isa("Baz"),
12 'isa after another stash has claimed the @ISA via glob assignment';
13ok 'Phoogh'->isa("Baz"),
14 'isa on the stash that claimed the @ISA via glob assignment';
15ok !Foogh->isa("Bar"),
16 '!isa when another stash has claimed the @ISA via glob assignment';
17ok !Phoogh->isa("Bar"),
18 '!isa on the stash that claimed the @ISA via glob assignment';
19
a5dba54a
FC
20@Foogh::ISA = "Bar";
21*Foogh::ISA = ["Baz"];
22
23ok 'Foogh'->isa("Baz"),
24 'isa after glob-to-ref assignment when *ISA is shared';
25ok 'Phoogh'->isa("Baz"),
26 'isa after glob-to-ref assignment on another stash when *ISA is shared';
27ok !Foogh->isa("Bar"),
28 '!isa after glob-to-ref assignment when *ISA is shared';
29ok !Phoogh->isa("Bar"),
30 '!isa after glob-to-ref assignment on another stash when *ISA is shared';
31
e1603486
FC
32@Foo::ISA = "Bar";
33*Phoo::ISA = \@Foo::ISA;
34@Foo::ISA = "Baz";
35
36ok 'Foo'->isa("Baz"),
37 'isa after another stash has claimed the @ISA via ref-to-glob assignment';
38ok 'Phoo'->isa("Baz"),
39 'isa on the stash that claimed the @ISA via ref-to-glob assignment';
40ok !Foo->isa("Bar"),
41 '!isa when another stash has claimed the @ISA via ref-to-glob assignment';
42ok !Phoo->isa("Bar"),
43 '!isa on the stash that claimed the @ISA via ref-to-glob assignment';