Skip to content

Commit 34d9693

Browse files
committed
t/tr.t: Add test case
While debugging, I noticed that some code in doop.c:S_trans_simple() was not getting called by anything in our test suite; this new test does so.
1 parent 3b554fd commit 34d9693

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

t/op/tr.t

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ BEGIN {
1414
use utf8;
1515
require Config;
1616

17-
plan tests => 317;
17+
plan tests => 318;
1818

1919
# Test this first before we extend the stack with other operations.
2020
# This caused an asan failure due to a bad write past the end of the stack.
@@ -1211,4 +1211,14 @@ for ("", nullrocow) {
12111211
is $c, 1, "Count for the above test";
12121212
}
12131213

1214+
{ # As of August 2024, the code to handle this situation is not otherwise
1215+
# exercised by the test suite
1216+
1217+
my $A = "A";
1218+
utf8::upgrade($A);
1219+
1220+
$A =~ tr/A/\xB6/; # B6 works in both ASCII and EBCDIC
1221+
is($A, "\xB6", "UTF-8 invariant in a UTF-8 string to UTF-8 variant");
1222+
}
1223+
12141224
1;

0 commit comments

Comments
 (0)