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