summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-03-27 11:11:22 -0600
committerKarl Williamson <khw@cpan.org>2015-03-13 10:53:10 -0600
commite50b61663ac0d05f318112524cf112051a7ae325 (patch)
tree62027f88a3a233325659f5e282fd78943cfbc087 /dist
parentdc6240c9d6df97879ecb94e74011463d8dbdc837 (diff)
downloadperl-e50b61663ac0d05f318112524cf112051a7ae325.tar.gz
dist/IO/t/io_utf8argv.t: Generalize for non-ASCII platforms.
Diffstat (limited to 'dist')
-rw-r--r--dist/IO/t/io_utf8argv.t21
1 files changed, 15 insertions, 6 deletions
diff --git a/dist/IO/t/io_utf8argv.t b/dist/IO/t/io_utf8argv.t
index a902eaf1e9..d6485f45dd 100644
--- a/dist/IO/t/io_utf8argv.t
+++ b/dist/IO/t/io_utf8argv.t
@@ -5,20 +5,29 @@ BEGIN {
print "1..0 # Skip: not perlio\n";
exit 0;
}
- require($ENV{PERL_CORE} ? "../../t/test.pl" : "./t/test.pl");
+ require($ENV{PERL_CORE} ? "../../t/test.pl" : "../t/test.pl");
}
use utf8;
+skip_all("EBCDIC platform; testing not core")
+ if $::IS_EBCDIC && ! $ENV{PERL_CORE};
plan(tests => 2);
+my $bytes =
+ "\xce\x9c\xe1\xbd\xb7\xce\xb1\x20\xcf\x80\xe1\xbd\xb1\xcf\x80\xce".
+ "\xb9\xce\xb1\x2c\x20\xce\xbc\xe1\xbd\xb0\x20\xcf\x80\xce\xbf\xce".
+ "\xb9\xe1\xbd\xb0\x20\xcf\x80\xe1\xbd\xb1\xcf\x80\xce\xb9\xce\xb1".
+ "\xcd\xbe\x0a";
+
+if ($::IS_EBCDIC) {
+ require($ENV{PERL_CORE} ? "../../t/charset_tools.pl" : "../t/charset_tools.pl");
+ $bytes = byte_utf8a_to_utf8n($bytes)
+}
+
open my $fh, ">:raw", 'io_utf8argv';
-print $fh
- "\xce\x9c\xe1\xbd\xb7\xce\xb1\x20\xcf\x80\xe1\xbd\xb1\xcf\x80\xce".
- "\xb9\xce\xb1\x2c\x20\xce\xbc\xe1\xbd\xb0\x20\xcf\x80\xce\xbf\xce".
- "\xb9\xe1\xbd\xb0\x20\xcf\x80\xe1\xbd\xb1\xcf\x80\xce\xb9\xce\xb1".
- "\xcd\xbe\x0a";
+print $fh $bytes;
close $fh or die "close: $!";