diff options
author | Brian Fraser <fraserbn@gmail.com> | 2011-09-26 17:24:44 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-10-06 13:01:09 -0700 |
commit | bf32a30c1f803670e172ece4c2d134a707a94f6c (patch) | |
tree | a251f4869b99446c6037ddb3d21a2b357f698b14 /t/re | |
parent | d527ce7c3632e2eaebee9f962268da87e0becd51 (diff) | |
download | perl-bf32a30c1f803670e172ece4c2d134a707a94f6c.tar.gz |
pp.c: pp_substr for UTF-8 globs.
Since typeglobs may have the UTF8 flag set now, we need to avoid
testing SvCUR on a potential glob, as that would trip an assertion.
Diffstat (limited to 't/re')
-rw-r--r-- | t/re/substr.t | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/t/re/substr.t b/t/re/substr.t index b48cb8f00c..e9ea12693a 100644 --- a/t/re/substr.t +++ b/t/re/substr.t @@ -24,7 +24,7 @@ $SIG{__WARN__} = sub { BEGIN { require './test.pl'; } -plan(356); +plan(358); run_tests() unless caller; @@ -748,3 +748,17 @@ ok eval { is($result_3363, "best", "ref-to-substr retains lvalue-ness under recursion [perl #3363]"); } + +{ + use utf8; + use open qw( :utf8 :std ); + no warnings 'once'; + + my $t = ""; + substr $t, 0, 0, *ワルド; + is($t, "*main::ワルド", "substr works on UTF-8 globs"); + + $t = "The World!"; + substr $t, 0, 9, *ザ::ワルド; + is($t, "*ザ::ワルド!", "substr works on a UTF-8 glob + stash"); +} |