From: Jarkko Hietaniemi Date: Mon, 31 Mar 2003 05:00:07 +0000 (+0000) Subject: Some low-hanging fruit for EBCDIC portability X-Git-Tag: accepted/trunk/20130322.191538~24515 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a901eef84aae580e80c0351bb32ee5bca0f349f7;p=platform%2Fupstream%2Fperl.git Some low-hanging fruit for EBCDIC portability (or for marking as EBCDIC todos) p4raw-id: //depot/perl@19097 --- diff --git a/ext/List/Util/t/isvstring.t b/ext/List/Util/t/isvstring.t index 1f679ca..9f05a67 100644 --- a/ext/List/Util/t/isvstring.t +++ b/ext/List/Util/t/isvstring.t @@ -26,7 +26,7 @@ print "1..4\n"; print "ok 1\n"; -$vs = 49.46.48; +$vs = ord("A") == 193 ? 241.75.240 : 49.46.48; print "not " unless $vs == "1.0"; print "ok 2\n"; diff --git a/lib/utf8.t b/lib/utf8.t index 85dfb2c..223bb1d 100644 --- a/lib/utf8.t +++ b/lib/utf8.t @@ -272,14 +272,17 @@ BANG # before the patch, the eval died with an error like: # "my" variable $strict::VERSION can't be in a package # -ok('' eq runperl(prog => <<'CODE'), "change #17928"); - my $code = qq{ my \$\xe3\x83\x95\xe3\x83\xbc = 5; }; +SKIP: { + skip("Embedded UTF-8 does not work in EBCDIC", 1) if ord("A") == 193; + ok('' eq runperl(prog => <<'CODE'), "change #17928"); + my $code = qq{ my \$\xe3\x83\x95\xe3\x83\xbc = 5; }; { use utf8; eval $code; print $@ if $@; } CODE +} { use utf8; @@ -323,7 +326,8 @@ END is("@i", "60 62 58 50 52 48 70 72 68", "utf8 heredoc index and rindex"); } -{ +SKIP: { + skip("Embedded UTF-8 does not work in EBCDIC", 1) if ord("A") == 193; use utf8; eval qq{is(q \xc3\xbc test \xc3\xbc, qq\xc2\xb7 test \xc2\xb7, "utf8 quote delimiters [perl #16823]");}; diff --git a/t/run/switchC.t b/t/run/switchC.t index 0f8f16a..fd05e13 100644 --- a/t/run/switchC.t +++ b/t/run/switchC.t @@ -20,10 +20,12 @@ my $r; my @tmpfiles = (); END { unlink @tmpfiles } +my $b = pack("C*", unpack("U0C*", pack("U",256))); + $r = runperl( switches => [ '-CO', '-w' ], prog => 'print chr(256)', stderr => 1 ); -like( $r, qr/^\xC4\x80(?:\r?\n)?$/s, '-CO: no warning on UTF-8 output' ); +like( $r, qr/^$b(?:\r?\n)?$/s, '-CO: no warning on UTF-8 output' ); SKIP: { if (exists $ENV{PERL_UNICODE} && @@ -33,14 +35,14 @@ SKIP: { $r = runperl( switches => [ '-CI', '-w' ], prog => 'print ord()', stderr => 1, - stdin => "\xC4\x80" ); + stdin => $b ); like( $r, qr/^256(?:\r?\n)?$/s, '-CI: read in UTF-8 input' ); } $r = runperl( switches => [ '-CE', '-w' ], prog => 'warn chr(256), qq(\n)', stderr => 1 ); -like( $r, qr/^\xC4\x80(?:\r?\n)?$/s, '-CE: UTF-8 stderr' ); +like( $r, qr/^$b(?:\r?\n)?$/s, '-CE: UTF-8 stderr' ); $r = runperl( switches => [ '-Co', '-w' ], prog => 'open(F, q(>out)); print F chr(256); close F', diff --git a/t/uni/write.t b/t/uni/write.t index 1a7564d..717fcab 100644 --- a/t/uni/write.t +++ b/t/uni/write.t @@ -9,6 +9,10 @@ BEGIN { print "1..0 # Skip: PerlIO required\n"; exit 0; } + if (ord("A") == 193) { + print "1..0 # Skip: EBCDIC porting needed\n"; + exit 0; + } } plan tests => 6;