From 875d2d1d34aa0a6657891a86ed83e7e89966f237 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 5 Sep 2011 19:54:11 -0500 Subject: don't allow invalid stash entry names --- t/paamayim_nekdotayim.t | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 t/paamayim_nekdotayim.t (limited to 't') 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; -- cgit v1.2.3-54-g00ecf