10 my $stash = Package::Stash->new('Foo');
11 my $val = $stash->get_package_symbol('%foo');
12 is($val, undef, "got nothing yet");
15 no warnings 'void', 'once';
19 my $stash = Package::Stash->new('Foo');
20 my $val = $stash->get_package_symbol('%foo');
21 is(ref($val), 'HASH', "got something");
23 is_deeply($stash->get_package_symbol('%foo'), {bar => 1},
24 "got the right variable");
30 my $stash = Package::Stash->new('Bar');
31 my $val = $stash->get_package_symbol('@foo');
32 is($val, undef, "got something");
35 no warnings 'void', 'once';
39 my $stash = Package::Stash->new('Bar');
40 my $val = $stash->get_package_symbol('@foo');
41 is(ref($val), 'ARRAY', "got something");
43 is_deeply($stash->get_package_symbol('@foo'), [1],
44 "got the right variable");
49 my $stash = Package::Stash->new('Baz');
50 my $val = $stash->get_or_add_package_symbol('%foo');
51 is(ref($val), 'HASH', "got something");
53 is_deeply($stash->get_or_add_package_symbol('%foo'), {bar => 1},
54 "got the right variable");
58 my $stash = Package::Stash->new('Quux');
59 my $val = $stash->get_or_add_package_symbol('@foo');
60 is(ref($val), 'ARRAY', "got something");
62 is_deeply($stash->get_or_add_package_symbol('@foo'), [1],
63 "got the right variable");