synopsis test
Jesse Luehrs [Tue, 11 May 2010 06:45:28 +0000 (01:45 -0500)]
t/010-synopsis.t [new file with mode: 0644]

diff --git a/t/010-synopsis.t b/t/010-synopsis.t
new file mode 100644 (file)
index 0000000..5d29573
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+use Stash::Manip;
+
+my $stash = Stash::Manip->new('Foo');
+$stash->add_package_symbol('%foo', {bar => 1});
+{
+    no warnings 'once';
+    is($Foo::foo{bar}, 1, "set in the stash properly");
+}
+ok(!$stash->has_package_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;