summaryrefslogtreecommitdiff
path: root/t/op/magic.t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-13 09:32:20 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-13 21:24:54 -0800
commit213084e431373aec68f094fabf7c87419d9c7688 (patch)
tree1061abfa3b658a625cc179807c861e0a493d111c /t/op/magic.t
parentffdb8bcde21504a3efe208b4d47bea445e7e23fd (diff)
downloadperl-213084e431373aec68f094fabf7c87419d9c7688.tar.gz
defined *{"+"} should not stop %+ from working
The same applies to %-. This is something I broke when merging is_magical_gv with gv_fetchpvn_flags. gv_fetchpvn_flags must make sure its *+ glob is present in the symbol table when it loads Tie::Hash::NamedCapture. If it adds it afterwards it will clobber another *+ that Tie::Hash::NamedCapture has autovivi- fied and tied in the mean time.
Diffstat (limited to 't/op/magic.t')
-rw-r--r--t/op/magic.t20
1 files changed, 19 insertions, 1 deletions
diff --git a/t/op/magic.t b/t/op/magic.t
index 494847f7f1..9b43069a00 100644
--- a/t/op/magic.t
+++ b/t/op/magic.t
@@ -5,7 +5,7 @@ BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
- plan (tests => 154);
+ plan (tests => 156);
}
# Test that defined() returns true for magic variables created on the fly,
@@ -545,6 +545,24 @@ foreach my $sig (qw(__DIE__ _BOGUS_HOOK KILL THIRSTY)) {
}
+# %+ %-
+SKIP: {
+ skip_if_miniperl("No XS in miniperl", 3);
+ # Make sure defined(*{"+"}) before %+ does not stop %+ from working
+ is
+ runperl(
+ prog => 'BEGIN { defined *{q-+-} } print qq-ok\n- if tied %+',
+ ),
+ "ok\n",
+ 'defined *{"+"} does not stop %+ from working';
+ is
+ runperl(
+ prog => 'BEGIN { defined *{q=-=} } print qq-ok\n- if tied %-',
+ ),
+ "ok\n",
+ 'defined *{"-"} does not stop %- from working';
+}
+
SKIP: {
skip_if_miniperl("No XS in miniperl", 3);