Commit | Line | Data |
d2d3faf4 |
1 | #!/usr/bin/env perl |
2 | use strict; |
3 | use warnings; |
4 | use Test::More; |
5 | |
6 | use Stash::Manip; |
7 | |
8 | { |
9 | my $stash = Stash::Manip->new('Foo'); |
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 | { |
18 | my $stash = Stash::Manip->new('Bar'); |
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; |