summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2020-04-22 11:02:16 +1000
committerSawyer X <xsawyerx@cpan.org>2020-05-27 11:09:11 +0300
commit69d4d9c8182035ceb44091b35b4b34a326a6f058 (patch)
treeca70aca6596871822967525b2993103bad1becee /t
parentfe49b83f91941b25e49385588692490299cf9357 (diff)
downloadperl-69d4d9c8182035ceb44091b35b4b34a326a6f058.tar.gz
fix utf8 length magic handling for scalar reverse
fixes #17737
Diffstat (limited to 't')
-rw-r--r--t/op/reverse.t11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/op/reverse.t b/t/op/reverse.t
index 16c732bc3f..babf3cf3ac 100644
--- a/t/op/reverse.t
+++ b/t/op/reverse.t
@@ -6,7 +6,7 @@ BEGIN {
set_up_inc('../lib');
}
-plan tests => 24;
+plan tests => 25;
is(reverse("abc"), "cba", 'simple reverse');
@@ -92,6 +92,15 @@ use Tie::Array;
is($a, $c, 'Unicode string double reversal matches original');
}
+{
+ # https://github.com/Perl/perl5/issues/17737
+ # utf8 length magic handling
+ # threw an assertion failure with -DDEBUGGING
+ my @x;
+ push @x, length reverse for split "-", "\x{100}--0";
+ is($x[1], 0, "check set magic being called to clear length magic");
+}
+
# [perl #132544] stack pointer used to go wild when nullary reverse
# required extending the stack
for(0..1000){()=(0..$_,scalar reverse )}