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