rename Stash::Manip -> Package::Stash
[gitmo/Package-Stash-PP.git] / t / 004-get.t
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use Test::More;
5
6 use Package::Stash;
7
8 {
9     my $stash = Package::Stash->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 = Package::Stash->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;