rename Stash::Manip -> Package::Stash
[gitmo/Package-Stash-PP.git] / t / 004-get.t
CommitLineData
d2d3faf4 1#!/usr/bin/env perl
2use strict;
3use warnings;
4use Test::More;
5
e94260da 6use 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
26done_testing;