This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [perl #27803] perl crashes when utf8::upgrade($offsetOK_scalar)
[perl5.git] / lib / utf8.t
index 90035e5..334a476 100644 (file)
@@ -37,7 +37,7 @@ no utf8; # Ironic, no?
 #
 #
 
-plan tests => 144;
+plan tests => 145;
 
 {
     # bug id 20001009.001
@@ -415,3 +415,13 @@ SKIP: {
     like($@, qr/^Modification of a read-only value attempted/,
         "utf8::encode should refuse to touch read-only values");
 }
+
+{
+    my $a =3D "456\xb6";
+    utf8::upgrade($a);
+
+    my $b =3D "123456\xb6";
+    $b =3D~ s/^...//;
+    utf8::upgrade($b);
+    is($b, $a, "utf8::upgrade OffsetOK");
+}