summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-08-30 01:24:15 -0500
committerJesse Luehrs <doy@tozt.net>2011-08-30 01:24:15 -0500
commit05f9df4446ab3452e7c6247cc9c8e7ec6d3561f5 (patch)
tree3a950956fd0dcc125dd905944b563cbcfa3d9ffb
parent6a47396a8c14fa10c8e145d96abf92665d01dca5 (diff)
downloadpackage-stash-xs-05f9df4446ab3452e7c6247cc9c8e7ec6d3561f5.tar.gz
package-stash-xs-05f9df4446ab3452e7c6247cc9c8e7ec6d3561f5.zip
update leak tests
-rw-r--r--xt/author/20-leaks.t20
-rw-r--r--xt/author/21-leaks-debug.t20
2 files changed, 28 insertions, 12 deletions
diff --git a/xt/author/20-leaks.t b/xt/author/20-leaks.t
index c37df91..767b4f1 100644
--- a/xt/author/20-leaks.t
+++ b/xt/author/20-leaks.t
@@ -59,16 +59,24 @@ use Symbol;
{
my $foo = Package::Stash->new('Foo');
- { local $TODO = $Package::Stash::IMPLEMENTATION eq 'PP'
- ? "the pure perl implementation leaks here somehow"
- : undef;
no_leaks_ok {
$foo->add_symbol('$scalar_init' => 1);
+ } "add_symbol scalar doesn't leak";
+ no_leaks_ok {
$foo->add_symbol('@array_init' => []);
+ } "add_symbol array doesn't leak";
+ no_leaks_ok {
$foo->add_symbol('%hash_init' => {});
+ } "add_symbol hash doesn't leak";
+ no_leaks_ok {
$foo->add_symbol('&code_init' => sub { "foo" });
+ } "add_symbol code doesn't leak";
+ { local $TODO = $Package::Stash::IMPLEMENTATION eq 'PP'
+ ? "the pure perl implementation leaks here somehow"
+ : undef;
+ no_leaks_ok {
$foo->add_symbol('io_init' => Symbol::geniosym);
- } "add_symbol doesn't leak";
+ } "add_symbol io doesn't leak";
}
is(exception {
is(Foo->code_init, 'foo', "sub installed correctly")
@@ -127,8 +135,8 @@ use Symbol;
@{$foo->get_or_add_symbol('@ISA')} = @super;
$foo->get_or_add_symbol('$glob');
} "get_or_add_symbol doesn't leak";
- { local $TODO = ($] < 5.010 || $Package::Stash::IMPLEMENTATION eq 'PP')
- ? "undef scalars aren't visible on 5.8, or from pure perl at all"
+ { local $TODO = $] < 5.010
+ ? "undef scalars aren't visible on 5.8"
: undef;
ok($foo->has_symbol('$glob'));
}
diff --git a/xt/author/21-leaks-debug.t b/xt/author/21-leaks-debug.t
index 7c453e7..0b7963f 100644
--- a/xt/author/21-leaks-debug.t
+++ b/xt/author/21-leaks-debug.t
@@ -61,16 +61,24 @@ use Symbol;
{
my $foo = Package::Stash->new('Foo');
- { local $TODO = $Package::Stash::IMPLEMENTATION eq 'PP'
- ? "the pure perl implementation leaks here somehow"
- : undef;
no_leaks_ok {
$foo->add_symbol('$scalar_init' => 1);
+ } "add_symbol scalar doesn't leak";
+ no_leaks_ok {
$foo->add_symbol('@array_init' => []);
+ } "add_symbol array doesn't leak";
+ no_leaks_ok {
$foo->add_symbol('%hash_init' => {});
+ } "add_symbol hash doesn't leak";
+ no_leaks_ok {
$foo->add_symbol('&code_init' => sub { "foo" });
+ } "add_symbol code doesn't leak";
+ { local $TODO = $Package::Stash::IMPLEMENTATION eq 'PP'
+ ? "the pure perl implementation leaks here somehow"
+ : undef;
+ no_leaks_ok {
$foo->add_symbol('io_init' => Symbol::geniosym);
- } "add_symbol doesn't leak";
+ } "add_symbol io doesn't leak";
}
is(exception {
is(Foo->code_init, 'foo', "sub installed correctly")
@@ -129,8 +137,8 @@ use Symbol;
@{$foo->get_or_add_symbol('@ISA')} = @super;
$foo->get_or_add_symbol('$glob');
} "get_or_add_symbol doesn't leak";
- { local $TODO = ($] < 5.010 || $Package::Stash::IMPLEMENTATION eq 'PP')
- ? "undef scalars aren't visible on 5.8, or from pure perl at all"
+ { local $TODO = $] < 5.010
+ ? "undef scalars aren't visible on 5.8"
: undef;
ok($foo->has_symbol('$glob'));
}