From b6a64d546b32da81d5a23e3df0ef47ffc6ed07b5 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 4 Jan 2013 02:49:47 -0600 Subject: sync tests --- xt/author/leaks.t | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) (limited to 'xt/author/leaks.t') diff --git a/xt/author/leaks.t b/xt/author/leaks.t index 18ec601..e3b50ab 100644 --- a/xt/author/leaks.t +++ b/xt/author/leaks.t @@ -43,18 +43,28 @@ use Symbol; my $foo = Package::Stash->new('Foo'); no_leaks_ok { $foo->name; + } "name accessor doesn't leak"; + no_leaks_ok { $foo->namespace; - } "accessors don't leak"; + } "namespace accessor doesn't leak"; } { my $foo = Package::Stash->new('Foo'); no_leaks_ok { $foo->add_symbol('$scalar'); + } "add_symbol scalar with no initializer doesn't leak"; + no_leaks_ok { $foo->add_symbol('@array'); + } "add_symbol array with no initializer doesn't leak"; + no_leaks_ok { $foo->add_symbol('%hash'); + } "add_symbol hash with no initializer doesn't leak"; + { local $TODO = "not sure why this leaks"; + no_leaks_ok { $foo->add_symbol('io'); - } "add_symbol doesn't leak"; + } "add_symbol io with no initializer doesn't leak"; + } } { @@ -83,11 +93,19 @@ use Symbol; my $foo = Package::Stash->new('Foo'); no_leaks_ok { $foo->remove_symbol('$scalar_init'); + } "remove_symbol scalar doesn't leak"; + no_leaks_ok { $foo->remove_symbol('@array_init'); + } "remove_symbol array doesn't leak"; + no_leaks_ok { $foo->remove_symbol('%hash_init'); + } "remove_symbol hash doesn't leak"; + no_leaks_ok { $foo->remove_symbol('&code_init'); + } "remove_symbol code doesn't leak"; + no_leaks_ok { $foo->remove_symbol('io_init'); - } "remove_symbol doesn't leak"; + } "remove_symbol io doesn't leak"; } { @@ -102,22 +120,38 @@ use Symbol; my $foo = Package::Stash->new('Foo'); no_leaks_ok { $foo->has_symbol('io'); + } "has_symbol io doesn't leak"; + no_leaks_ok { $foo->has_symbol('%hash'); + } "has_symbol hash doesn't leak"; + no_leaks_ok { $foo->has_symbol('@array_init'); + } "has_symbol array doesn't leak"; + no_leaks_ok { $foo->has_symbol('$glob'); + } "has_symbol nonexistent scalar doesn't leak"; + no_leaks_ok { $foo->has_symbol('&something_else'); - } "has_symbol doesn't leak"; + } "has_symbol nonexistent code doesn't leak"; } { my $foo = Package::Stash->new('Foo'); no_leaks_ok { $foo->get_symbol('io'); + } "get_symbol io doesn't leak"; + no_leaks_ok { $foo->get_symbol('%hash'); + } "get_symbol hash doesn't leak"; + no_leaks_ok { $foo->get_symbol('@array_init'); + } "get_symbol array doesn't leak"; + no_leaks_ok { $foo->get_symbol('$glob'); + } "get_symbol nonexistent scalar doesn't leak"; + no_leaks_ok { $foo->get_symbol('&something_else'); - } "get_symbol doesn't leak"; + } "get_symbol nonexistent code doesn't leak"; } { -- cgit v1.2.3-54-g00ecf