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