]> Savannah Git Hosting - gnulib.git/commitdiff
wcwidth: Avoid test failure on AIX 7.2.
authorBruno Haible <bruno@clisp.org>
Thu, 12 Dec 2019 12:02:28 +0000 (13:02 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 12 Dec 2019 12:02:28 +0000 (13:02 +0100)
* tests/test-wcwidth.c (main): Don't fail if wcwidth(0x200B) is
negative.
* doc/posix-functions/wcwidth.texi: Mention the AIX issue.

ChangeLog
doc/posix-functions/wcwidth.texi
tests/test-wcwidth.c

index d62eb6145fbd778b35e9dcd2959069773d5ce478..5d1df96cfd2dae45e18aad1d47055efffb7b9267 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-12-12  Bruno Haible  <bruno@clisp.org>
+
+       wcwidth: Avoid test failure on AIX 7.2.
+       * tests/test-wcwidth.c (main): Don't fail if wcwidth(0x200B) is
+       negative.
+       * doc/posix-functions/wcwidth.texi: Mention the AIX issue.
+
 2019-12-12  Bruno Haible  <bruno@clisp.org>
 
        ilogbl: Work around Cygwin bug.
index 0acc1c4aff340e5c035cc50f9711897548e40709..a3afe9ba0dfab8d670b9af6592e871ae967b644f 100644 (file)
@@ -29,4 +29,8 @@ Portability problems not fixed by Gnulib:
 @item
 On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
 accommodate all Unicode characters.
+@item
+This function treats zero-width spaces like control characters on some
+platforms:
+AIX 7.2.
 @end itemize
index 8e9cea3e4970f4a4949c8b7e612cf3be7b97390c..ecb50cd00f837f4e923e16610483de67b7dacd94 100644 (file)
@@ -69,7 +69,11 @@ main ()
 #endif
 
       /* Test width of some zero width characters.  */
-      ASSERT (wcwidth (0x200B) == 0);
+      /* While it is desirable that U+200B, U+200C, U+200D have width 0,
+         because this makes wcswidth work better on strings that contain these
+         characters, it is acceptable if an implementation treats these
+         characters like control characters.  */
+      ASSERT (wcwidth (0x200B) <= 0);
       ASSERT (wcwidth (0xFEFF) <= 0);
 
       /* Test width of some math symbols.