diff --git a/lib/Test2/Tools/Mock.pm b/lib/Test2/Tools/Mock.pm index 26da56975..91f33b6e7 100644 --- a/lib/Test2/Tools/Mock.pm +++ b/lib/Test2/Tools/Mock.pm @@ -188,7 +188,8 @@ sub _generate_class { my $prefix = __PACKAGE__; for (1 .. 100) { - my $postfix = join '', map { chr(rand(26) + 65) } 1 .. 32; + my $postfix = join '', map { chr(utf8::unicode_to_native(rand(26) + 65)) + } 1 .. 32; my $class = $prefix . '::__TEMP__::' . $postfix; my $file = $class; $file =~ s{::}{/}g; diff --git a/t/modules/Tools/Compare.t b/t/modules/Tools/Compare.t index a22b81785..537df6dc9 100644 --- a/t/modules/Tools/Compare.t +++ b/t/modules/Tools/Compare.t @@ -154,12 +154,12 @@ subtest is => sub { fail_table( header => [qw/GOT OP CHECK/], - rows => [["\N{U+1}\N{U+2}\N{U+3}", 'eq', "\N{U+1}\N{U+2}\N{U+4}"]], + rows => [["\x{01}\x{02}\x{03}", 'eq', "\x{01}\x{02}\x{04}"]], ); fail_table( header => [qw/PATH GOT OP CHECK/], - rows => [['$*', "\N{U+1}\N{U+2}\N{U+3}", 'eq', "\N{U+1}\N{U+2}\N{U+4}"]], + rows => [['$*', "\x{01}\x{02}\x{03}", 'eq', "\x{01}\x{02}\x{04}"]], ); event Ok => sub {