diff options
author | Bruno Haible <bruno@clisp.org> | 2023-04-06 00:43:39 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-04-06 00:43:39 +0200 |
commit | 0e8546cb6c74559f2a41c54d1048e9eb4f463034 (patch) | |
tree | ebe6c32f9a97741fb73d4e06dab85a0ed07100a5 | |
parent | e330a98d3de0897b11970f1b1999b6279a95d169 (diff) | |
download | gnulib-0e8546cb6c74559f2a41c54d1048e9eb4f463034.tar.gz |
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.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tests/test-string-desc-quotearg.c | 8 |
2 files changed, 13 insertions, 2 deletions
@@ -1,5 +1,12 @@ 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. * lib/stdlib.in.h: For random_r, include <stdint.h> always. * modules/random_r (Depends-on): Depend on 'stdint' always. diff --git a/tests/test-string-desc-quotearg.c b/tests/test-string-desc-quotearg.c index 0a3c42d35c..dd523f27be 100644 --- a/tests/test-string-desc-quotearg.c +++ b/tests/test-string-desc-quotearg.c @@ -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. */ |