From 4b60e9f353517e2034cc77f16b97580a5982b9c6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 14 Jan 2023 17:00:54 -0800 Subject: [PATCH] tests: port U+10000+ to AIX 7.2 * tests/hangul-syllable, tests/surrogate-search: 32-bit AIX has WCHAR_MAX == 0xFFFF, and so cannot handle U+10000 and greater. Skip tests involving such chars on this platform. --- tests/hangul-syllable | 9 +++++++++ tests/surrogate-search | 13 +++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/hangul-syllable b/tests/hangul-syllable index 961875d..481279a 100755 --- a/tests/hangul-syllable +++ b/tests/hangul-syllable @@ -99,6 +99,15 @@ for i in 355; do done done done + +# On platforms like 32-bit AIX where WCHAR_MAX == 0xFFFF, skip checks +# where the corresponding Unicode characters are not supported. +if test $fail -eq 0; then + printf '\360\220\200\200\n' >in || framework_failure_ + grep '^.$' in >out 2>&1 || fail=1 + cmp in out || skip_ 'platform does not support U+10000' +fi + for i in 360; do for j in 220 277; do for k in 200 277; do diff --git a/tests/surrogate-search b/tests/surrogate-search index 65d0285..7dfea54 100755 --- a/tests/surrogate-search +++ b/tests/surrogate-search @@ -28,15 +28,20 @@ esac fail=0 -s_pair=$(printf '\360\220\220\205') -printf '%s\n' "$s_pair" > in || framework_failure_ - LC_ALL=en_US.UTF-8 export LC_ALL +# On platforms like 32-bit AIX where WCHAR_MAX == 0xFFFF, skip this check, +# since the corresponding Unicode characters are not supported. +printf '\360\220\200\200\n' >in || framework_failure_ +grep '^.$' in >out || fail=1 +compare in out || skip_ 'platform does not support U+10000' + +printf '\360\220\220\205\n' > in || framework_failure_ + for opt in '' -i -E -F -iE -iF; do grep --file=in $opt in > out 2>&1 || fail=1 - compare out in || fail=1 + compare in out || fail=1 done Exit $fail