diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-08-05 14:44:29 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-08-05 14:44:29 -0500 |
commit | 35ac42dfa898f4ed2124a52545f7f7c2d2bd0449 (patch) | |
tree | d6c30d3e47a0e153635a3dc6bf961827eafa81b5 /t/edge-cases.t | |
parent | 5a4d63bd5f5f484ca406b6cf7f6c8d0fb9326a0a (diff) | |
download | package-stash-xs-35ac42dfa898f4ed2124a52545f7f7c2d2bd0449.tar.gz package-stash-xs-35ac42dfa898f4ed2124a52545f7f7c2d2bd0449.zip |
copy tests over
Diffstat (limited to 't/edge-cases.t')
-rwxr-xr-x | t/edge-cases.t | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/t/edge-cases.t b/t/edge-cases.t index 6bed48e..7c82626 100755 --- a/t/edge-cases.t +++ b/t/edge-cases.t @@ -53,38 +53,4 @@ is(ref($constant), 'CODE', "expanded a constant into a coderef"); is(ref($stash->get_symbol('$glob')), '', "nothing yet"); is(ref($stash->get_or_add_symbol('$glob')), 'SCALAR', "got an empty scalar"); -my $Bar = Package::Stash->new('Bar'); -my $foo = 3; -$foo =~ s/3/4/; -my $bar = 4.5; -$bar =~ s/4/5/; - -is(exception { $Bar->add_symbol('$foo', \$foo) }, undef, - "can add PVIV values"); -is(exception { $Bar->add_symbol('$bar', \$bar) }, undef, - "can add PVNV values"); -is(exception { bless \$bar, 'Foo'; $Bar->add_symbol('$bar2', $bar) }, undef, - "can add PVMG values"); -is(exception { $Bar->add_symbol('$baz', qr/foo/) }, undef, - "can add regex values"); -is(exception { undef $bar; $Bar->add_symbol('$quux', \$bar) }, undef, - "can add undef values that aren't NULL"); - -use_ok('CompileTime'); - -{ - package Gets::Deleted; - sub bar { } -} - -{ - my $delete = Package::Stash->new('Gets::Deleted'); - ok($delete->has_symbol('&bar'), "sees the method"); - { - no strict 'refs'; - delete ${'main::Gets::'}{'Deleted::'}; - } - ok(!$delete->has_symbol('&bar'), "method goes away when stash is deleted"); -} - done_testing; |