here's that test failure
[gitmo/Package-Stash-XS.git] / t / isa.t
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use lib 't/lib';
5 use Test::More;
6
7 use Package::Stash;
8
9 {
10     package Foo;
11 }
12
13 {
14     package Bar;
15     sub bar { }
16 }
17
18 {
19     my $stash = Package::Stash->new('Foo');
20     my @ISA = ('Bar');
21     @{$stash->get_or_add_symbol('@ISA')} = @ISA;
22     isa_ok('Foo', 'Bar');
23     isa_ok(bless({}, 'Foo'), 'Bar');
24 }
25
26 {
27     package Baz;
28     sub foo { }
29 }
30
31 {
32     my $stash = Package::Stash->new('Quux');
33     {
34         my $isa = $stash->get_or_add_symbol('@ISA');
35         @$isa = ('Baz');
36         isa_ok('Quux', 'Baz');
37         isa_ok(bless({}, 'Quux'), 'Baz');
38         ok(Quux->can('foo'));
39     }
40     {
41         my $isa = $stash->get_or_add_symbol('@ISA');
42         @$isa = ('Bar');
43         isa_ok('Quux', 'Bar');
44         isa_ok(bless({}, 'Quux'), 'Bar');
45         ok(Quux->can('bar'));
46     }
47 }
48
49 done_testing;