convert the XS implementation to its own dist
[gitmo/Package-Stash-XS.git] / t / 10-synopsis.t
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use lib 't/lib';
5 use Test::More;
6
7 use Package::Stash;
8
9 my $stash = Package::Stash->new('Foo');
10 $stash->add_symbol('%foo', {bar => 1});
11 {
12     no warnings 'once';
13     is($Foo::foo{bar}, 1, "set in the stash properly");
14 }
15 ok(!$stash->has_symbol('$foo'), "doesn't have anything in scalar slot");
16 my $namespace = $stash->namespace;
17 is_deeply(*{ $namespace->{foo} }{HASH}, {bar => 1}, "namespace works properly");
18
19 done_testing;