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