Skip to content

Commit

Permalink
z/OS: an easy test nit
Browse files Browse the repository at this point in the history
Message-Id: <200607271700.k6RH02V1355005@kosh.hut.fi>

p4raw-id: //depot/perl@28629
  • Loading branch information
jhi authored and H.Merijn Brand committed Jul 28, 2006
1 parent ad02613 commit 501f55b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ext/PerlIO/t/encoding.t
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,21 @@ print "ok 14\n";

# Try decoding some bad stuff
open(F,'>:raw',$threebyte) || die "Cannot open $threebyte:$!";
print F "foo\xF0\x80\x80\x80bar\n\x80foo\n";
if (ord('A') == 193) { # EBCDIC
print F "foo\x8c\x80\x80\x80bar\n\x80foo\n";
} else {
print F "foo\xF0\x80\x80\x80bar\n\x80foo\n";
}
close(F);

open(F,'<:encoding(utf-8)',$threebyte) || die "Cannot open $threebyte:$!";
$dstr = join(":", <F>);
close(F);
print "not " unless $dstr eq "foo\\xF0\\x80\\x80\\x80bar\n:\\x80foo\n";
if (ord('A') == 193) { # EBCDIC
print "not " unless $dstr eq "foo\\x8C\\x80\\x80\\x80bar\n:\\x80foo\n";
} else {
print "not " unless $dstr eq "foo\\xF0\\x80\\x80\\x80bar\n:\\x80foo\n";
}
print "ok 15\n";

END {
Expand Down

0 comments on commit 501f55b

Please sign in to comment.