diff --git a/t/op/evalbytes.t b/t/op/evalbytes.t index 9961072d7c1c..cca7c04787a0 100644 --- a/t/op/evalbytes.t +++ b/t/op/evalbytes.t @@ -3,7 +3,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require './test.pl'; + require './test.pl'; require './charset_tools.pl'; } plan(tests => 8); @@ -27,8 +27,9 @@ is evalbytes($upcode), "\xff\xfe", 'evalbytes on upgraded extra-ASCII'; use utf8; is evalbytes($code), "\xff\xfe", 'evalbytes ignores outer utf8 pragma'; } -is evalbytes "use utf8; '\xc4\x80'", chr 256, 'use utf8 within evalbytes'; -chop($upcode = "use utf8; '\xc4\x80'" . chr 256); +my $U_100 = byte_utf8a_to_utf8n("\xc4\x80"); +is evalbytes "use utf8; $U_100", chr 256, 'use utf8 within evalbytes'; +chop($upcode = "use utf8; $U_100" . chr 256); is evalbytes $upcode, chr 256, 'use utf8 within evalbytes on utf8 string'; eval { evalbytes chr 256 }; like $@, qr/Wide character/, 'evalbytes croaks on non-bytes';