Commit | Line | Data |
---|---|---|
e1603486 FC |
1 | #!./perl |
2 | ||
3 | BEGIN { chdir 't'; @INC = '../lib'; require './test.pl' } | |
4 | ||
a5dba54a | 5 | plan 12; |
e1603486 FC |
6 | |
7 | @Foogh::ISA = "Bar"; | |
8 | *Phoogh::ISA = *Foogh::ISA; | |
9 | @Foogh::ISA = "Baz"; | |
10 | ||
11 | ok 'Foogh'->isa("Baz"), | |
12 | 'isa after another stash has claimed the @ISA via glob assignment'; | |
13 | ok 'Phoogh'->isa("Baz"), | |
14 | 'isa on the stash that claimed the @ISA via glob assignment'; | |
15 | ok !Foogh->isa("Bar"), | |
16 | '!isa when another stash has claimed the @ISA via glob assignment'; | |
17 | ok !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 | ||
23 | ok 'Foogh'->isa("Baz"), | |
24 | 'isa after glob-to-ref assignment when *ISA is shared'; | |
25 | ok 'Phoogh'->isa("Baz"), | |
26 | 'isa after glob-to-ref assignment on another stash when *ISA is shared'; | |
27 | ok !Foogh->isa("Bar"), | |
28 | '!isa after glob-to-ref assignment when *ISA is shared'; | |
29 | ok !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 | ||
36 | ok 'Foo'->isa("Baz"), | |
37 | 'isa after another stash has claimed the @ISA via ref-to-glob assignment'; | |
38 | ok 'Phoo'->isa("Baz"), | |
39 | 'isa on the stash that claimed the @ISA via ref-to-glob assignment'; | |
40 | ok !Foo->isa("Bar"), | |
41 | '!isa when another stash has claimed the @ISA via ref-to-glob assignment'; | |
42 | ok !Phoo->isa("Bar"), | |
43 | '!isa on the stash that claimed the @ISA via ref-to-glob assignment'; |