summaryrefslogtreecommitdiffstats
path: root/t/001-basic.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-05-11 23:40:09 -0500
committerJesse Luehrs <doy@tozt.net>2010-05-11 23:40:09 -0500
commit6ee333b86d6a1141415a70dacb38f30f8d8e2e9b (patch)
treea6da8e5b96b67dc039d69a9aa404a5d35293629e /t/001-basic.t
parentd2d3faf49a59ca1c3e39255af2061b001b26446e (diff)
downloadpackage-stash-6ee333b86d6a1141415a70dacb38f30f8d8e2e9b.tar.gz
package-stash-6ee333b86d6a1141415a70dacb38f30f8d8e2e9b.zip
add TODO test
Diffstat (limited to 't/001-basic.t')
-rw-r--r--t/001-basic.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/001-basic.t b/t/001-basic.t
index ef95bf1..33d1117 100644
--- a/t/001-basic.t
+++ b/t/001-basic.t
@@ -248,4 +248,28 @@ dies_ok {
$foo_stash->add_package_symbol('$bar', *Bar::foo{IO})
} "can't initialize a slot with the wrong type of value";
+# check compile time manipulation
+
+{
+ package Baz;
+
+ our $foo = 23;
+ our @foo = "bar";
+ our %foo = (baz => 1);
+ sub foo { }
+ open *foo, '<', $0;
+ BEGIN { Stash::Manip->new(__PACKAGE__)->remove_package_symbol('&foo') }
+}
+
+{
+ my $stash = Stash::Manip->new('Baz');
+ { local $TODO = "getting undef for some reason";
+ is(${ $stash->get_package_symbol('$foo') }, 23, "got \$foo");
+ }
+ is_deeply($stash->get_package_symbol('@foo'), ['bar'], "got \@foo");
+ is_deeply($stash->get_package_symbol('%foo'), {baz => 1}, "got \%foo");
+ ok(!$stash->has_package_symbol('&foo'), "got \&foo");
+ is($stash->get_package_symbol('foo'), *Baz::foo{IO}, "got foo");
+}
+
done_testing;