summaryrefslogtreecommitdiffstats
path: root/t/03-io.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-11-15 13:02:14 -0600
committerJesse Luehrs <doy@tozt.net>2010-11-15 13:05:14 -0600
commit2905fb35f8d7e19e0b9422060689d71c72bb6f39 (patch)
treef7609ecb5acc5517e36a26dd68cb51838ec8e8c3 /t/03-io.t
parentd1f721b320d72e83c0cb24c45fe9995a6dcf29c2 (diff)
downloadpackage-stash-2905fb35f8d7e19e0b9422060689d71c72bb6f39.tar.gz
package-stash-2905fb35f8d7e19e0b9422060689d71c72bb6f39.zip
almost complete pure perl implementation
the leak tests are failing for some reason, need to track that down
Diffstat (limited to 't/03-io.t')
-rw-r--r--t/03-io.t31
1 files changed, 16 insertions, 15 deletions
diff --git a/t/03-io.t b/t/03-io.t
index 147b745..ecade2a 100644
--- a/t/03-io.t
+++ b/t/03-io.t
@@ -1,6 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
+use lib 't/lib';
use Test::More;
use Test::Fatal;
@@ -22,29 +23,29 @@ use Package::Stash;
{
my $stash = Package::Stash->new('Foo');
- ok($stash->has_package_symbol('&foo'), "has &foo");
- ok($stash->has_package_symbol('foo'), "has foo");
- $stash->remove_package_symbol('&foo');
- ok(!$stash->has_package_symbol('&foo'), "has &foo");
- ok($stash->has_package_symbol('foo'), "has foo");
+ ok($stash->has_symbol('&foo'), "has &foo");
+ ok($stash->has_symbol('foo'), "has foo");
+ $stash->remove_symbol('&foo');
+ ok(!$stash->has_symbol('&foo'), "has &foo");
+ ok($stash->has_symbol('foo'), "has foo");
}
{
my $stash = Package::Stash->new('Bar');
- ok($stash->has_package_symbol('&bar'), "has &bar");
- ok($stash->has_package_symbol('bar'), "has bar");
- $stash->remove_package_symbol('bar');
- ok($stash->has_package_symbol('&bar'), "has &bar");
- ok(!$stash->has_package_symbol('bar'), "has bar");
+ ok($stash->has_symbol('&bar'), "has &bar");
+ ok($stash->has_symbol('bar'), "has bar");
+ $stash->remove_symbol('bar');
+ ok($stash->has_symbol('&bar'), "has &bar");
+ ok(!$stash->has_symbol('bar'), "has bar");
}
{
my $stash = Package::Stash->new('Baz');
- ok(!exception {
- $stash->add_package_symbol('baz', *Foo::foo{IO});
- }, "can add an IO symbol");
- ok($stash->has_package_symbol('baz'), "has baz");
- is($stash->get_package_symbol('baz'), *Foo::foo{IO}, "got the right baz");
+ is(exception {
+ $stash->add_symbol('baz', *Foo::foo{IO});
+ }, undef, "can add an IO symbol");
+ ok($stash->has_symbol('baz'), "has baz");
+ is($stash->get_symbol('baz'), *Foo::foo{IO}, "got the right baz");
}
done_testing;