summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-09-05 19:54:11 -0500
committerJesse Luehrs <doy@tozt.net>2011-09-05 19:54:11 -0500
commit875d2d1d34aa0a6657891a86ed83e7e89966f237 (patch)
treefc1cc6d916f938b73796b416cc5b0d2a3d623202 /t
parented131e4112640c781865aad216cb3c424e5d2ab9 (diff)
downloadpackage-stash-875d2d1d34aa0a6657891a86ed83e7e89966f237.tar.gz
package-stash-875d2d1d34aa0a6657891a86ed83e7e89966f237.zip
don't allow invalid stash entry names
Diffstat (limited to 't')
-rw-r--r--t/paamayim_nekdotayim.t23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/paamayim_nekdotayim.t b/t/paamayim_nekdotayim.t
new file mode 100644
index 0000000..2096cb4
--- /dev/null
+++ b/t/paamayim_nekdotayim.t
@@ -0,0 +1,23 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use lib 't/lib';
+use Test::More;
+use Test::Fatal;
+
+use Package::Stash;
+
+my $stash = Package::Stash->new('Foo');
+# this segfaulted on the xs version
+like(
+ exception { $stash->add_symbol('@bar::baz') },
+ qr/^Variable names may not contain ::/,
+ "can't add symbol with ::"
+);
+like(
+ exception { $stash->get_symbol('@bar::baz') },
+ qr/^Variable names may not contain ::/,
+ "can't add symbol with ::"
+);
+
+done_testing;