Commit | Line | Data |
3b9f59fd |
1 | #!/usr/bin/env perl |
2 | use strict; |
3 | use warnings; |
4 | use Test::More; |
5 | |
e94260da |
6 | use Package::Stash; |
3b9f59fd |
7 | |
e94260da |
8 | my $stash = Package::Stash->new('Foo'); |
3b9f59fd |
9 | $stash->add_package_symbol('%foo', {bar => 1}); |
10 | { |
11 | no warnings 'once'; |
12 | is($Foo::foo{bar}, 1, "set in the stash properly"); |
13 | } |
14 | ok(!$stash->has_package_symbol('$foo'), "doesn't have anything in scalar slot"); |
15 | my $namespace = $stash->namespace; |
16 | is_deeply(*{ $namespace->{foo} }{HASH}, {bar => 1}, "namespace works properly"); |
17 | |
18 | done_testing; |