Commit | Line | Data |
---|---|---|
e1603486 FC |
1 | #!./perl |
2 | ||
624c42e2 N |
3 | BEGIN { |
4 | chdir 't' if -d 't'; | |
5 | require './test.pl'; | |
6 | set_up_inc('../lib'); | |
7 | } | |
e1603486 | 8 | |
6e1b2de7 | 9 | plan 13; |
e1603486 FC |
10 | |
11 | @Foogh::ISA = "Bar"; | |
12 | *Phoogh::ISA = *Foogh::ISA; | |
13 | @Foogh::ISA = "Baz"; | |
14 | ||
15 | ok 'Foogh'->isa("Baz"), | |
16 | 'isa after another stash has claimed the @ISA via glob assignment'; | |
17 | ok 'Phoogh'->isa("Baz"), | |
18 | 'isa on the stash that claimed the @ISA via glob assignment'; | |
19 | ok !Foogh->isa("Bar"), | |
20 | '!isa when another stash has claimed the @ISA via glob assignment'; | |
21 | ok !Phoogh->isa("Bar"), | |
22 | '!isa on the stash that claimed the @ISA via glob assignment'; | |
23 | ||
a5dba54a FC |
24 | @Foogh::ISA = "Bar"; |
25 | *Foogh::ISA = ["Baz"]; | |
26 | ||
27 | ok 'Foogh'->isa("Baz"), | |
28 | 'isa after glob-to-ref assignment when *ISA is shared'; | |
29 | ok 'Phoogh'->isa("Baz"), | |
30 | 'isa after glob-to-ref assignment on another stash when *ISA is shared'; | |
31 | ok !Foogh->isa("Bar"), | |
32 | '!isa after glob-to-ref assignment when *ISA is shared'; | |
33 | ok !Phoogh->isa("Bar"), | |
34 | '!isa after glob-to-ref assignment on another stash when *ISA is shared'; | |
35 | ||
e1603486 FC |
36 | @Foo::ISA = "Bar"; |
37 | *Phoo::ISA = \@Foo::ISA; | |
38 | @Foo::ISA = "Baz"; | |
39 | ||
40 | ok 'Foo'->isa("Baz"), | |
41 | 'isa after another stash has claimed the @ISA via ref-to-glob assignment'; | |
42 | ok 'Phoo'->isa("Baz"), | |
43 | 'isa on the stash that claimed the @ISA via ref-to-glob assignment'; | |
44 | ok !Foo->isa("Bar"), | |
45 | '!isa when another stash has claimed the @ISA via ref-to-glob assignment'; | |
46 | ok !Phoo->isa("Bar"), | |
47 | '!isa on the stash that claimed the @ISA via ref-to-glob assignment'; | |
6e1b2de7 FC |
48 | |
49 | *Fooo::ISA = *Baro::ISA; | |
50 | @Fooo::ISA = "Bazo"; | |
51 | sub Bazo::ook { "Baz" } | |
52 | sub L::ook { "See" } | |
53 | Baro->ook; | |
54 | local *Fooo::ISA = ["L"]; | |
55 | is 'Baro'->ook, 'See', 'localised *ISA=$ref assignment'; |