X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Futf8.t;h=acd64bfb213786f89277283e4fdefd4a8ad54d89;hb=411cc70a34f8fb9bcdf0a5306f32b31a7092ea1e;hp=aaa06853f14b5c70490407748c41baf22e5a63dc;hpb=097fb8e2acde8522bd4ee4e5e00d3d2b810e2e56;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/utf8.t b/lib/utf8.t index aaa0685..acd64bf 100644 --- a/lib/utf8.t +++ b/lib/utf8.t @@ -1,9 +1,16 @@ #!./perl +my $has_perlio; + BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; + unless ($has_perlio = find PerlIO::Layer 'perlio') { + print < 94; # Now we do the real byte sequences that are valid UTF8 (map { ["the utf8 sequence for chr $_->[0]", - qq(\$a = "$_->[1]"; \$b = show \$a), qr/^>$_->[2]<$/], + qq{\$a = "$_->[1]"; \$b = show \$a}, qr/^>$_->[2]<$/], ["no utf8; for the utf8 sequence for chr $_->[0]", qq(no utf8; \$a = "$_->[1]"; \$b = show \$a), qr/^>$_->[2]<$/], ["use utf8; for the utf8 sequence for chr $_->[0]", @@ -165,6 +172,7 @@ BANG foreach (@tests) { my ($why, $prog, $expect) = @$_; open P, ">$progfile" or die "Can't open '$progfile': $!"; + binmode(P, ":bytes") if $has_perlio; print P $show, $prog, '; print $b' or die "Print to 'progfile' failed: $!"; close P or die "Can't close '$progfile': $!";