convert the XS implementation to its own dist
[gitmo/Package-Stash-XS.git] / t / 10-synopsis.t
CommitLineData
3b9f59fd 1#!/usr/bin/env perl
2use strict;
3use warnings;
c53d2df2 4use lib 't/lib';
3b9f59fd 5use Test::More;
6
e94260da 7use Package::Stash;
3b9f59fd 8
e94260da 9my $stash = Package::Stash->new('Foo');
15c104e2 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}
15c104e2 15ok(!$stash->has_symbol('$foo'), "doesn't have anything in scalar slot");
3b9f59fd 16my $namespace = $stash->namespace;
17is_deeply(*{ $namespace->{foo} }{HASH}, {bar => 1}, "namespace works properly");
18
19done_testing;