diff --git a/lib/Test2/Tools/Mock.pm b/lib/Test2/Tools/Mock.pm index c1fc4a5bc..3abfcfceb 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..18d3f442c 100644 --- a/t/modules/Tools/Compare.t +++ b/t/modules/Tools/Compare.t @@ -2,7 +2,7 @@ use Test2::Bundle::Extended -target => 'Test2::Tools::Compare'; use Test2::Util::Table(); BEGIN { - $ENV{TABLE_TERM_SIZE} = 80; + $ENV{TABLE_TERM_SIZE} = 250; $ENV{T2_AUTO_DUMP} = 0; $ENV{T2_AUTO_DEPARSE} = 0; } @@ -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 {