From 7d36752dfb8434954e17524a0f6a5fb68352c1eb Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 10 Jul 2012 17:44:47 -0500 Subject: vivify globs properly, so they pick up the right magic --- t/isa.t | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 't') diff --git a/t/isa.t b/t/isa.t index ce852a6..f2e516f 100644 --- a/t/isa.t +++ b/t/isa.t @@ -12,11 +12,38 @@ use Package::Stash; { package Bar; + sub bar { } } -my $stash = Package::Stash->new('Foo'); -my @ISA = ('Bar'); -@{$stash->get_or_add_symbol('@ISA')} = @ISA; -isa_ok('Foo', 'Bar'); +{ + my $stash = Package::Stash->new('Foo'); + my @ISA = ('Bar'); + @{$stash->get_or_add_symbol('@ISA')} = @ISA; + isa_ok('Foo', 'Bar'); + isa_ok(bless({}, 'Foo'), 'Bar'); +} + +{ + package Baz; + sub foo { } +} + +{ + my $stash = Package::Stash->new('Quux'); + { + my $isa = $stash->get_or_add_symbol('@ISA'); + @$isa = ('Baz'); + isa_ok('Quux', 'Baz'); + isa_ok(bless({}, 'Quux'), 'Baz'); + ok(Quux->can('foo')); + } + { + my $isa = $stash->get_or_add_symbol('@ISA'); + @$isa = ('Bar'); + isa_ok('Quux', 'Bar'); + isa_ok(bless({}, 'Quux'), 'Bar'); + ok(Quux->can('bar')); + } +} done_testing; -- cgit v1.2.3-54-g00ecf