summaryrefslogtreecommitdiff
path: root/t/lib/strict
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-04-08 23:04:38 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-04-19 20:09:12 -0700
commit707475cd74fef60149c3f020c29472b1814b3e9b (patch)
tree7f052ae110b07e864f38da0e48e95441e1ff4a55 /t/lib/strict
parent6379d4a9afb32e86e55704579c9ac81237309672 (diff)
downloadperl-707475cd74fef60149c3f020c29472b1814b3e9b.tar.gz
Make strict vars respect ‘package ĵ; *ĵ::bar = [];’
In this particular case, the name of the current package in UTF-8 (it cannot be expressed in Latin-1) is the same byte sequence as the name of the package being assigned to in Latin-1. Some of the logic in stashpv_hvname_match was faulty. It worked for a Latin-1 current package assigning to a glob in a UTF-8 package, but not the other way around.
Diffstat (limited to 't/lib/strict')
-rw-r--r--t/lib/strict/vars9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/lib/strict/vars b/t/lib/strict/vars
index 568d991978..b8c6d1f6e2 100644
--- a/t/lib/strict/vars
+++ b/t/lib/strict/vars
@@ -554,3 +554,12 @@ package Foo;
use strict;
eval 'package foo; @bar = 1' or die;
EXPECT
+########
+# UTF8 and Latin1 package names equivalent at the byte level
+use utf8;
+# ĵ in UTF-8 is the same as ĵ in Latin-1
+package ĵ;
+*ĵ::bar = [];
+use strict;
+eval 'package ĵ; @bar = 1' or die;
+EXPECT