summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-03-27 12:05:53 -0600
committerKarl Williamson <khw@cpan.org>2015-03-05 21:48:25 -0700
commit4deba822d105ded9bee2a0c8e50f46af3ca1aa93 (patch)
tree3d2c91cd585bd0339521bc8269bda19c47fd60bd /ext
parent0516404baa9906c79101b3a98ce5c43791c354c2 (diff)
downloadperl-4deba822d105ded9bee2a0c8e50f46af3ca1aa93.tar.gz
ext/XS-APItest/t/utf8.t: Fix so passes EBCDIC
This involves skipping much of the tests, because it would be painful to generalize for the different EBCDIC code pages.
Diffstat (limited to 'ext')
-rw-r--r--ext/XS-APItest/t/utf8.t11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/XS-APItest/t/utf8.t b/ext/XS-APItest/t/utf8.t
index bc5a7ed0c1..8322cb9460 100644
--- a/ext/XS-APItest/t/utf8.t
+++ b/ext/XS-APItest/t/utf8.t
@@ -5,13 +5,15 @@ use Test::More;
use XS::APItest;
+my $pound_sign = chr utf8::unicode_to_native(163);
+
foreach ([0, '', '', 'empty'],
[0, 'N', 'N', '1 char'],
[1, 'NN', 'N', '1 char substring'],
[-2, 'Perl', 'Rules', 'different'],
- [0, chr 163, chr 163, 'pound sign'],
- [1, chr (163) . 10, chr (163) . 1, '10 pounds is more than 1 pound'],
- [1, chr(163) . chr(163), chr 163, '2 pound signs are more than 1'],
+ [0, $pound_sign, $pound_sign, 'pound sign'],
+ [1, $pound_sign . 10, $pound_sign . 1, '10 pounds is more than 1 pound'],
+ [1, $pound_sign . $pound_sign, $pound_sign, '2 pound signs are more than 1'],
[-2, ' $!', " \x{1F42B}!", 'Camels are worth more than 1 dollar'],
[-1, '!', "!\x{1F42A}", 'Initial substrings match'],
) {
@@ -24,6 +26,8 @@ foreach ([0, '', '', 'empty'],
is(bytes_cmp_utf8($right, $left), -$expect, "$desc reversed");
}
+if (ord("A") == 65) { # EBCDIC is too hard to test for malformations
+
# Test uft8n_to_uvchr(). These provide essentially complete code coverage.
# Copied from utf8.h
@@ -319,5 +323,6 @@ foreach my $test (@tests) {
}
}
}
+}
done_testing;