string-desc-quotearg tests: Avoid a test failure on Haiku.
authorBruno Haible <bruno@clisp.org>
Wed, 5 Apr 2023 22:43:39 +0000 (00:43 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 5 Apr 2023 22:43:39 +0000 (00:43 +0200)
* tests/test-string-desc-quotearg.c (main): For the
clocale_quoting_style, accept also the U+2018 and U+2019 characters in
UTF-8 encoding.

ChangeLog
tests/test-string-desc-quotearg.c

index 9dc59e1a5e466ca52f847d2867a9acb2fc9028e9..4d8b00264c0f0cfc8cb31bbeec811a0c3039af66 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-04-05  Bruno Haible  <bruno@clisp.org>
+
+       string-desc-quotearg tests: Avoid a test failure on Haiku.
+       * tests/test-string-desc-quotearg.c (main): For the
+       clocale_quoting_style, accept also the U+2018 and U+2019 characters in
+       UTF-8 encoding.
+
 2023-04-05  Bruno Haible  <bruno@clisp.org>
 
        random_r: Fix compilation error on Haiku.
index 0a3c42d35c5cb1ae958a4ecb999634b7f09e3cc7..dd523f27bebfb37555addd352995a838d994553e 100644 (file)
@@ -63,13 +63,17 @@ main (void)
   /* Test string_desc_quotearg_n_style.  */
   {
     char *ret = string_desc_quotearg_n_style (1, clocale_quoting_style, s2);
-    ASSERT (memcmp (ret, "\"The\\0quick\\0brown\\0\\0fox\\0\"", 28 + 1) == 0);
+    ASSERT (memcmp (ret, "\"The\\0quick\\0brown\\0\\0fox\\0\"", 28 + 1) == 0
+            || /* if the locale has UTF-8 encoding */
+               memcmp (ret, "\342\200\230The\\0quick\\0brown\\0\\0fox\\0\342\200\231", 32 + 1) == 0);
   }
 
   /* Test string_desc_quotearg_style.  */
   {
     char *ret = string_desc_quotearg_style (clocale_quoting_style, s2);
-    ASSERT (memcmp (ret, "\"The\\0quick\\0brown\\0\\0fox\\0\"", 28 + 1) == 0);
+    ASSERT (memcmp (ret, "\"The\\0quick\\0brown\\0\\0fox\\0\"", 28 + 1) == 0
+            || /* if the locale has UTF-8 encoding */
+               memcmp (ret, "\342\200\230The\\0quick\\0brown\\0\\0fox\\0\342\200\231", 32 + 1) == 0);
   }
 
   /* Test string_desc_quotearg_char.  */