summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-01-05 22:51:28 -0600
committerJesse Luehrs <doy@tozt.net>2011-01-05 22:51:28 -0600
commitfbef4983066edbde84d915b4968e65b0efb59534 (patch)
tree5e0fb754814b48950b72ca14b296512806db64aa
parent8f652223870ba3c0dfc311c64afd76dcc9778469 (diff)
downloadpackage-stash-xs-fbef4983066edbde84d915b4968e65b0efb59534.tar.gz
package-stash-xs-fbef4983066edbde84d915b4968e65b0efb59534.zip
add test for earlier scalar bug
-rwxr-xr-xt/07-edge-cases.t12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/07-edge-cases.t b/t/07-edge-cases.t
index cf75847..02e281b 100755
--- a/t/07-edge-cases.t
+++ b/t/07-edge-cases.t
@@ -3,6 +3,7 @@ use strict;
use warnings;
use lib 't/lib';
use Test::More;
+use Test::Fatal;
use Package::Stash;
@@ -52,4 +53,15 @@ 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");
+
done_testing;