blob: 9f599482171fb1d1dcb0bf875ea604bd7c7d4475 (
plain) (
tree)
|
|
#!/usr/bin/env perl
use strict;
use warnings;
use lib 't/lib';
use Test::More;
use Package::Stash;
my $stash = Package::Stash->new('Foo');
$stash->add_symbol('%foo', {bar => 1});
{
no warnings 'once';
is($Foo::foo{bar}, 1, "set in the stash properly");
}
ok(!$stash->has_symbol('$foo'), "doesn't have anything in scalar slot");
my $namespace = $stash->namespace;
is_deeply(*{ $namespace->{foo} }{HASH}, {bar => 1}, "namespace works properly");
done_testing;
|