Skip to content

Commit

Permalink
t/tr.t: Add test case
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
khwilliamson committed Aug 24, 2024
1 parent 3b554fd commit 34d9693
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion t/op/tr.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BEGIN {
use utf8;
require Config;

plan tests => 317;
plan tests => 318;

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

{ # As of August 2024, the code to handle this situation is not otherwise
# exercised by the test suite

my $A = "A";
utf8::upgrade($A);

$A =~ tr/A/\xB6/; # B6 works in both ASCII and EBCDIC
is($A, "\xB6", "UTF-8 invariant in a UTF-8 string to UTF-8 variant");
}

1;

0 comments on commit 34d9693

Please sign in to comment.