From: Phil Carmody Date: Thu, 20 Sep 2018 19:33:23 +0000 (+0300) Subject: lib-fts: replace repeated explicit hex utf8 with cleaner macro in tokeniser test X-Git-Tag: 2.3.9~1275 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94a30fa2a478367b9be138e3f09148bfa815e371;p=thirdparty%2Fdovecot%2Fcore.git lib-fts: replace repeated explicit hex utf8 with cleaner macro in tokeniser test utf8 is too line-noisy, this improves readability. Signed-off-by: Phil Carmody --- diff --git a/src/lib-fts/test-fts-tokenizer.c b/src/lib-fts/test-fts-tokenizer.c index 5d5260285e..2136dcc6ab 100644 --- a/src/lib-fts/test-fts-tokenizer.c +++ b/src/lib-fts/test-fts-tokenizer.c @@ -49,9 +49,10 @@ static const char *test_inputs[] = { "123456789012345678901234567890x''," /* \xe28099 = U+2019 is a smart quote, sometimes used as an apostrophe */ - "\xE2\x80\x99 \xE2\x80\x99 \xE2\x80\x99\xE2\x80\x99 \xE2\x80\x99\xE2\x80\x99\xE2\x80\x99 \xE2\x80\x99quoted text\xE2\x80\x99\xE2\x80\x99word\xE2\x80\x99 \xE2\x80\x99hlo words\xE2\x80\x99 you\xE2\x80\x99re78901234567890123456789012 bad\xE2\x80\x99\xE2\x80\x99\xE2\x80\x99word\xE2\x80\x99\xE2\x80\x99\xE2\x80\x99pre post\xE2\x80\x99\xE2\x80\x99\xE2\x80\x99", +#define SQ "\xE2\x80\x99" + SQ " " SQ " " SQ SQ " " SQ SQ SQ " " SQ "quoted text" SQ SQ "word" SQ " " SQ "hlo words" SQ " you" SQ "re78901234567890123456789012 bad" SQ SQ SQ "word" SQ SQ SQ "pre post" SQ SQ SQ, - "you\xE2\x80\x99re\xE2\x80\x99xyz", + "you" SQ "re" SQ "xyz", /* whitespace: with Unicode(utf8) U+FF01(ef bc 81)(U+2000(e2 80 80) and U+205A(e2 81 9a) and U+205F(e2 81 9f) */ @@ -62,7 +63,7 @@ static const char *test_inputs[] = { "hello world\xEF\xBC\x8E", /* TR29 WB5a */ - "l\xE2\x80\x99homme l\xE2\x80\x99humanit\xC3\xA9 d\xE2\x80\x99immixtions qu\xE2\x80\x99il aujourd'hui que'euq" + "l" SQ "homme l" SQ "humanit\xC3\xA9 d" SQ "immixtions qu" SQ "il aujourd'hui que'euq" }; static void test_fts_tokenizer_find(void)