diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-07-10 17:44:47 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-07-10 17:55:30 -0500 |
commit | 7d36752dfb8434954e17524a0f6a5fb68352c1eb (patch) | |
tree | 6b1947103a2c9bd7881da64afe33397646eba499 /t | |
parent | df62307a1ff48a0015984903995e4c51b3498c0a (diff) | |
download | package-stash-7d36752dfb8434954e17524a0f6a5fb68352c1eb.tar.gz package-stash-7d36752dfb8434954e17524a0f6a5fb68352c1eb.zip |
vivify globs properly, so they pick up the right magic
Diffstat (limited to 't')
-rw-r--r-- | t/isa.t | 35 |
1 files changed, 31 insertions, 4 deletions
@@ -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; |