From afad11a2ce2b95ce853f2a09df2cbf068be080c3 Mon Sep 17 00:00:00 2001 From: Ricardo Signes Date: Sun, 8 Mar 2015 18:20:22 -0400 Subject: move back to a stable Test-Simple, v1.001014 --- cpan/Test-Simple/t/Test-Stream-PackageUtil.t | 38 ---------------------------- 1 file changed, 38 deletions(-) delete mode 100644 cpan/Test-Simple/t/Test-Stream-PackageUtil.t (limited to 'cpan/Test-Simple/t/Test-Stream-PackageUtil.t') diff --git a/cpan/Test-Simple/t/Test-Stream-PackageUtil.t b/cpan/Test-Simple/t/Test-Stream-PackageUtil.t deleted file mode 100644 index 76d80d87ed..0000000000 --- a/cpan/Test-Simple/t/Test-Stream-PackageUtil.t +++ /dev/null @@ -1,38 +0,0 @@ -use strict; -use warnings; - -use Test::Stream; -use Test::More; - -use ok 'Test::Stream::PackageUtil'; - -can_ok(__PACKAGE__, qw/package_sym package_purge_sym/); - -my $ok = package_sym(__PACKAGE__, CODE => 'ok'); -is($ok, \&ok, "package sym gave us the code symbol"); - -my $todo = package_sym(__PACKAGE__, SCALAR => 'TODO'); -is($todo, \$TODO, "got the TODO scalar"); - -our $foo = 'foo'; -our @foo = ('f', 'o', 'o'); -our %foo = (f => 'oo'); -sub foo { 'foo' }; - -is(foo(), 'foo', "foo() is defined"); -is($foo, 'foo', '$foo is defined'); -is_deeply(\@foo, [ 'f', 'o', 'o' ], '@foo is defined'); -is_deeply(\%foo, { f => 'oo' }, '%foo is defined'); - -package_purge_sym(__PACKAGE__, CODE => 'foo'); - -is($foo, 'foo', '$foo is still defined'); -is_deeply(\@foo, [ 'f', 'o', 'o' ], '@foo is still defined'); -is_deeply(\%foo, { f => 'oo' }, '%foo is still defined'); -my $r = eval { __PACKAGE__->foo() }; -my $e = $@; -ok(!$r, "Failed to call foo()"); -like($e, qr/Can't locate object method "foo" via package "main"/, "foo() is not defined anymore"); -ok(!__PACKAGE__->can('foo'), "can() no longer thinks we can do foo()"); - -done_testing; -- cgit v1.2.1