Commit | Line | Data |
d2d3faf4 |
1 | #!/usr/bin/env perl |
2 | use strict; |
3 | use warnings; |
4 | use Test::More; |
5 | |
e94260da |
6 | use Package::Stash; |
d2d3faf4 |
7 | |
8 | { |
e94260da |
9 | my $stash = Package::Stash->new('Foo'); |
d2d3faf4 |
10 | my $val = $stash->get_package_symbol('%foo'); |
11 | is(ref($val), 'HASH', "got something"); |
12 | $val->{bar} = 1; |
13 | is_deeply($stash->get_package_symbol('%foo'), {bar => 1}, |
14 | "got the right variable"); |
15 | } |
16 | |
17 | { |
e94260da |
18 | my $stash = Package::Stash->new('Bar'); |
d2d3faf4 |
19 | my $val = $stash->get_package_symbol('@foo'); |
20 | is(ref($val), 'ARRAY', "got something"); |
21 | push @$val, 1; |
22 | is_deeply($stash->get_package_symbol('@foo'), [1], |
23 | "got the right variable"); |
24 | } |
25 | |
26 | done_testing; |