summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-03-31 05:00:07 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-03-31 05:00:07 +0000
commita901eef84aae580e80c0351bb32ee5bca0f349f7 (patch)
tree90198102999120bcafd2308ece135653dc120dad
parent0be47ac6ef3026eb6eaaf22fb128d8e2d947e0c7 (diff)
downloadperl-a901eef84aae580e80c0351bb32ee5bca0f349f7.tar.gz
Some low-hanging fruit for EBCDIC portability
(or for marking as EBCDIC todos) p4raw-id: //depot/perl@19097
-rw-r--r--ext/List/Util/t/isvstring.t2
-rw-r--r--lib/utf8.t10
-rw-r--r--t/run/switchC.t8
-rw-r--r--t/uni/write.t4
4 files changed, 17 insertions, 7 deletions
diff --git a/ext/List/Util/t/isvstring.t b/ext/List/Util/t/isvstring.t
index 1f679ca0ef..9f05a67da6 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 85dfb2cb2e..223bb1d825 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 0f8f16a6ce..fd05e133dd 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(<STDIN>)',
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 1a7564d3ac..717fcaba54 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;