summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-10-16 19:37:29 -0600
committerKarl Williamson <khw@cpan.org>2015-03-13 10:53:10 -0600
commitf227048406ab4605a8a3459c4b08d8c1aad78d86 (patch)
tree7c88000cecdf34b6d2d7529e468bb032d85a4a6a /lib
parente50b61663ac0d05f318112524cf112051a7ae325 (diff)
downloadperl-f227048406ab4605a8a3459c4b08d8c1aad78d86.tar.gz
t/lib/open.t: Generalize for EBCDIC platforms
This involved changing a \xff to \xfe because it is expecting it to be a character whose representation is different when encoded in UTF-8, and on some EBCDIC platforms, \xff is UTF-8 invariant. I suppose there could be a code page where \xfe is invariant, so this .t would have to be made more general if that ever comes to be.
Diffstat (limited to 'lib')
-rw-r--r--lib/open.t13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/open.t b/lib/open.t
index d24c83de04..0e676ebedf 100644
--- a/lib/open.t
+++ b/lib/open.t
@@ -5,6 +5,7 @@ BEGIN {
@INC = '../lib';
require Config; import Config;
require './test.pl';
+ require './charset_tools.pl';
}
plan 23;
@@ -197,13 +198,17 @@ SKIP: {
'use open q\:encoding(UTF-8)\;',
'if(($_ = <STDIN>) eq qq-\x{100}\n-) { print qq-stdin ok\n- }',
'else { print qq-got -, join(q q q, map ord, split//), "\n" }',
- 'print STDOUT qq-\x{ff}\n-;',
- 'print STDERR qq-\x{ff}\n-;',
+ 'print STDOUT qq-\x{fe}\n-;',
+ 'print STDERR qq-\x{fe}\n-;',
],
- stdin => "\xc4\x80\n",
+ stdin => byte_utf8a_to_utf8n("\xc4\x80") . "\n",
stderr => 1,
),
- "stdin ok\n\xc3\xbf\n\xc3\xbf\n",
+ "stdin ok\n"
+ . byte_utf8a_to_utf8n("\xc3\xbe")
+ . "\n"
+ . byte_utf8a_to_utf8n("\xc3\xbe")
+ . "\n",
"use open without :std does not affect standard handles",
;
}