test-fts-tokenizer.c revision c4b772bfbdafe68ac1a0076eab26cd681f8e5046
02c335c23bf5fa225a467c19f2c063fb0dc7b8c3Timo Sirainen/* Copyright (c) 2014-2015 Dovecot authors, see the included COPYING file */
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen/* TODO: fix including and linking of this. */
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen/* #include "fts-tokenizer-generic-private.h" */
d477acb83e14a776ece4ca94dcd1869e75d0c6eeTimo Sirainenstatic void test_fts_tokenizer_generic_only(void)
9dd1c256910f1fb42823116a641e7edb3ad11970Timo Sirainen static const unsigned char input[] =
d477acb83e14a776ece4ca94dcd1869e75d0c6eeTimo Sirainen "hello world\r\nAnd there\twas: text "
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen "galore, and longlonglongabcdefghijklmnopqrstuvwxyz more.\n\n (\"Hello world\")last ";
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen static const char *const expected_output[] = {
ab90f702ceedb7ba445a9a592be0b213b27cbafaStephan Bosch tok_class = fts_tokenizer_find(FTS_TOKENIZER_GENERIC_NAME);
ab90f702ceedb7ba445a9a592be0b213b27cbafaStephan Bosch test_assert(fts_tokenizer_create(tok_class, NULL, NULL, &tok, &error) == 0);
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen/*TODO: Uncomment when fts-tokenizer-generic-private.h inclusion is fixed */
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen/*test_assert(((struct generic_fts_tokenizer *) tok)->algorithm == BOUNDARY_ALGORITHM_SIMPLE);*/
da7f1a07f583df8905684a7b78469960afd7c78dPhil Carmody while (fts_tokenizer_next(tok, input, sizeof(input)-1, &token) > 0) {
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen while (fts_tokenizer_next(tok, NULL, 0, &token) > 0) {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainenstatic void test_fts_tokenizer_generic_unicode_whitespace(void)
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen /* with Unicode(utf8) U+FF01(ef bc 81)(U+2000(e2 80 80) and
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen U+205A(e2 81 9a) and U+205F(e2 81 9f )*/
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen static const unsigned char input[] =
51fb710488efa419a2964335c30451c62b9633b1Timo Sirainen "hello\xEF\xBC\x81world\r\nAnd\xE2\x80\x80there\twas: text "
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen "galore\xE2\x81\x9F""and\xE2\x81\x9Amore.\n\n";
93a7d1ee4b518b5c85f9721dc6539e4dab6aae00Timo Sirainen static const char *const expected_output[] = {
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen test_begin("fts tokenizer generic simple with Unicode whitespace");
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen fts_tokenizer_register(fts_tokenizer_generic);
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen tok_class = fts_tokenizer_find(FTS_TOKENIZER_GENERIC_NAME);
635df5b4cbcd7b24c825e01d9dd66d3a4274c4c7Timo Sirainen test_assert(fts_tokenizer_create(tok_class, NULL, NULL, &tok, &error) == 0);
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen while (fts_tokenizer_next(tok, input, sizeof(input)-1, &token) > 0) {
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen while (fts_tokenizer_next(tok, NULL, 0, &token) > 0) {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen fts_tokenizer_unregister(fts_tokenizer_generic);
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainenstatic void test_fts_tokenizer_char_generic_only(void)
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen static const unsigned char input[] =
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen "abc@example.com, "
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen "Bar Baz <bar@example.org>, "
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen "foo@domain";
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen static const char *const expected_output[] = {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen "bar", "example", "org", "foo", "domain", NULL
f7f25f9e1a38678d0e97d2e609beac16285fac6bTimo Sirainen unsigned int i;
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen test_begin("fts tokenizer generic simple input one character at a time");
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen fts_tokenizer_register(fts_tokenizer_generic);
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen test_assert(fts_tokenizer_create(fts_tokenizer_generic, NULL, NULL, &tok, &error) == 0);
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen fts_tokenizer_next(tok, &input[i], 1, &token) :
559f278a4c54d9fa7e0f2e96ebceda30562f9009Timo Sirainen fts_tokenizer_unregister(fts_tokenizer_generic);
380dbb60ae291cbe39d1f710284562ca9167150bTimo Sirainenconst char *const tr29_settings[] = {"algorithm", "tr29", NULL};
b484ab4b55b0d5341f2f4dd98a655a75f0bf1275Timo Sirainenstatic void test_fts_tokenizer_generic_tr29_only(void)
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen static const unsigned char input[] =
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen "hello world\r\n\nAnd there\twas: text "
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen "galore, and more.\n\n (\"Hello world\")3.14 3,14 last"
1b823b2b7790a1e1b7974fcf11a4c48a28e70f37Timo Sirainen " longlonglongabcdefghijklmnopqrstuvwxyz 1.";
544a727de8ab0e6c55cab18a7ee475fffdf5eff3Timo Sirainen static const char *const expected_output[] = {
04052d7cacaa866a3f00afb4e104fa46c04c1dd7Timo Sirainen "3,14", "last", "longlonglongabcdefghijklmnopqr", "1", NULL
3cf67672fdc87583cb23ce088c95bb5dee60e74dTimo Sirainen fts_tokenizer_register(fts_tokenizer_generic);
b484ab4b55b0d5341f2f4dd98a655a75f0bf1275Timo Sirainen tok_class = fts_tokenizer_find(FTS_TOKENIZER_GENERIC_NAME);
b484ab4b55b0d5341f2f4dd98a655a75f0bf1275Timo Sirainen test_assert(fts_tokenizer_create(tok_class, NULL, tr29_settings, &tok, &error) == 0);
3cf67672fdc87583cb23ce088c95bb5dee60e74dTimo Sirainen while (fts_tokenizer_next(tok, input, sizeof(input)-1, &token) > 0) {
1b823b2b7790a1e1b7974fcf11a4c48a28e70f37Timo Sirainen while (fts_tokenizer_next(tok, NULL, 0, &token) > 0) {
9dd1c256910f1fb42823116a641e7edb3ad11970Timo Sirainen fts_tokenizer_unregister(fts_tokenizer_generic);
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen/* TODO: U+206F is in "Format" and therefore currently not word break.
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen This definitely needs to be remapped. */
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainenstatic void test_fts_tokenizer_generic_tr29_unicode_whitespace(void)
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen /* with Unicode(utf8) U+2000(e2 80 80) and U+205A(e2 81 9a) and U+205F(e2
544a727de8ab0e6c55cab18a7ee475fffdf5eff3Timo Sirainen static const unsigned char input[] =
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen "hello world\r\nAnd\xE2\x80\x80there\twas: text "
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen "galore\xE2\x81\x9F""and\xE2\x81\x9Amore.\n\n";
04052d7cacaa866a3f00afb4e104fa46c04c1dd7Timo Sirainen static const char *const expected_output[] = {
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen test_begin("fts tokenizer generic TR29 with Unicode whitespace");
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen fts_tokenizer_register(fts_tokenizer_generic);
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen tok_class = fts_tokenizer_find(FTS_TOKENIZER_GENERIC_NAME);
1b823b2b7790a1e1b7974fcf11a4c48a28e70f37Timo Sirainen test_assert(fts_tokenizer_create(tok_class, NULL, tr29_settings, &tok, &error) == 0);
74fb6b5a156c5a61bb6ec827089bb142a10547ddTimo Sirainen while (fts_tokenizer_next(tok, input, sizeof(input)-1, &token) > 0) {
04052d7cacaa866a3f00afb4e104fa46c04c1dd7Timo Sirainen while (fts_tokenizer_next(tok, NULL, 0, &token) > 0) {
b484ab4b55b0d5341f2f4dd98a655a75f0bf1275Timo Sirainen fts_tokenizer_unregister(fts_tokenizer_generic);
3cf67672fdc87583cb23ce088c95bb5dee60e74dTimo Sirainenstatic void test_fts_tokenizer_generic_tr29_midnumlet_end(void)
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen /* u+FF0E is EF BC 8E */
1b823b2b7790a1e1b7974fcf11a4c48a28e70f37Timo Sirainen static const unsigned char input[] =
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen "hello world\xEF\xBC\x8E";
544a727de8ab0e6c55cab18a7ee475fffdf5eff3Timo Sirainen static const char *const expected_output[] = {
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen test_begin("fts tokenizer generic TR29 with MinNumLet U+FF0E at end");
57d2429fae575e96ca276355af675deb66b76d00Timo Sirainen fts_tokenizer_register(fts_tokenizer_generic);
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen tok_class = fts_tokenizer_find(FTS_TOKENIZER_GENERIC_NAME);
401b0787fff2dc986a5321ddb32acb1947ff66b0Timo Sirainen test_assert(fts_tokenizer_create(tok_class, NULL, tr29_settings, &tok, &error) == 0);
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen while (fts_tokenizer_next(tok, input, sizeof(input)-1, &token) > 0) {
401b0787fff2dc986a5321ddb32acb1947ff66b0Timo Sirainen while (fts_tokenizer_next(tok, NULL, 0, &token) > 0) {
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen fts_tokenizer_unregister(fts_tokenizer_generic);
50e20db49f29917fe9adcf1b56b11badf28bd0e4Timo Sirainenstatic void test_fts_tokenizer_char_generic_tr29_only(void)
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen static const unsigned char input[] =
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen "abc@example.com, "
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen "Bar Baz <bar@example.org>, "
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen "foo@domain";
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen static const char *const expected_output[] = {
203bb272804e4394ae07103cdc8ce67041ba21a1Aki Tuomi unsigned int i;
203bb272804e4394ae07103cdc8ce67041ba21a1Aki Tuomi test_begin("fts tokenizer generic TR29 input one character at a time");
203bb272804e4394ae07103cdc8ce67041ba21a1Aki Tuomi test_assert(fts_tokenizer_create(fts_tokenizer_generic, NULL, tr29_settings, &tok, &error) == 0);
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen fts_tokenizer_next(tok, &input[i], 1, &token) :
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen fts_tokenizer_unregister(fts_tokenizer_generic);
f01eb1f51d618633c0189be9ab60a774f47fb7dfTimo Sirainenstatic void test_fts_tokenizer_line_address_only(void)
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen static const char *const input[] = {
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen "abc@example.com",
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen " Bar Baz <bar@example.org>",
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainen "foo@domain",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen " moro foo@domain Bar Baz <bar@example.org>"
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen static const char *const expected_output[] = {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen "foo@domain", "foo@domain", "bar@example.org", NULL
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen unsigned int i;
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen test_begin("fts tokenizer email address only, input one line at a time");
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen fts_tokenizer_register(fts_tokenizer_email_address);
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen test_assert(fts_tokenizer_create(fts_tokenizer_email_address, NULL, NULL, &tok, &error) == 0);
203bb272804e4394ae07103cdc8ce67041ba21a1Aki Tuomi fts_tokenizer_next(tok, (unsigned char *)input[i],
203bb272804e4394ae07103cdc8ce67041ba21a1Aki Tuomi if (ret == 0) {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen fts_tokenizer_unregister(fts_tokenizer_email_address);
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainenstatic void test_fts_tokenizer_char_address_only(void)
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen static const unsigned char input[] =
401b0787fff2dc986a5321ddb32acb1947ff66b0Timo Sirainen "@invalid invalid@ abc@example.com, "
401b0787fff2dc986a5321ddb32acb1947ff66b0Timo Sirainen "Bar Baz <bar@example.org>, "
1da01eaa962be13cee75771064e2256b1a82d90aTimo Sirainen "foo@domain";
f01eb1f51d618633c0189be9ab60a774f47fb7dfTimo Sirainen static const char *const expected_output[] = {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen unsigned int i;
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen test_begin("fts tokenizer email address only, input one character at a time");
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen fts_tokenizer_register(fts_tokenizer_email_address);
383d0e8c24451468d6bea17e4b55d74de744abe6Timo Sirainen test_assert(fts_tokenizer_create(fts_tokenizer_email_address, NULL, NULL, &tok, &error) == 0);
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen fts_tokenizer_next(tok, &input[i], 1, &token) :
738cfeb96c4b9cd92aa3c791d77734c2745cdd1aTimo Sirainen fts_tokenizer_unregister(fts_tokenizer_email_address);
738cfeb96c4b9cd92aa3c791d77734c2745cdd1aTimo Sirainenstatic void test_fts_tokenizer_rand_address_only(void)
738cfeb96c4b9cd92aa3c791d77734c2745cdd1aTimo Sirainen static const unsigned char input[] =
738cfeb96c4b9cd92aa3c791d77734c2745cdd1aTimo Sirainen "@invalid invalid@ Abc Dfg <abc.dfg@example.com>, "
738cfeb96c4b9cd92aa3c791d77734c2745cdd1aTimo Sirainen "Foo Bar (comment)foo.bar@host.example.org foo ";
738cfeb96c4b9cd92aa3c791d77734c2745cdd1aTimo Sirainen static const char *const expected_output[] = {
738cfeb96c4b9cd92aa3c791d77734c2745cdd1aTimo Sirainen "abc.dfg@example.com",
738cfeb96c4b9cd92aa3c791d77734c2745cdd1aTimo Sirainen "foo.bar@host.example.org",
738cfeb96c4b9cd92aa3c791d77734c2745cdd1aTimo Sirainen test_begin("fts tokenizer email address, input random length");
738cfeb96c4b9cd92aa3c791d77734c2745cdd1aTimo Sirainen fts_tokenizer_register(fts_tokenizer_email_address);
4addfd26372c6ae32ec93252696d86fd32081327Timo Sirainen test_assert(fts_tokenizer_create(fts_tokenizer_email_address, NULL,
4addfd26372c6ae32ec93252696d86fd32081327Timo Sirainen fts_tokenizer_next(tok, &input[i], step, &token) :
4addfd26372c6ae32ec93252696d86fd32081327Timo Sirainen fts_tokenizer_unregister(fts_tokenizer_email_address);
3190f12fb96daf61f7c880390472e18184cbb2d8Timo Sirainenstatic void test_fts_tokenizer_address_char(void)
3190f12fb96daf61f7c880390472e18184cbb2d8Timo Sirainen static const unsigned char input[] =
3190f12fb96daf61f7c880390472e18184cbb2d8Timo Sirainen "@invalid invalid@ abc@example.com, "
3190f12fb96daf61f7c880390472e18184cbb2d8Timo Sirainen "Bar Baz <bar@example.org>, "
a5bcc9f96bf56121a0704433c12137a43cd093beTimo Sirainen "foo@domain";
4addfd26372c6ae32ec93252696d86fd32081327Timo Sirainen static const char *const expected_output[] = {
a5bcc9f96bf56121a0704433c12137a43cd093beTimo Sirainen "invalid", "invalid", "abc", "example", "com", "abc@example.com", "Bar", "Baz",
7289c5600711b45f30fe289ab5b0293b51d87041Timo Sirainen unsigned int i;
15f526e5ac611b4532568d131fcd0abf664abe41Timo Sirainen test_begin("fts tokenizer email address + parent, input one character at a time");
7289c5600711b45f30fe289ab5b0293b51d87041Timo Sirainen test_assert(fts_tokenizer_create(fts_tokenizer_generic, NULL, NULL, &gen_tok, &error) == 0);
f93c833d644ecff0b0f80bee4f1cdde3e697b5c8Timo Sirainen test_assert(fts_tokenizer_create(fts_tokenizer_email_address, gen_tok, NULL, &tok, &error) == 0);
f93c833d644ecff0b0f80bee4f1cdde3e697b5c8Timo Sirainen fts_tokenizer_next(tok, &input[i], 1, &token) :
7289c5600711b45f30fe289ab5b0293b51d87041Timo Sirainenstatic void test_fts_tokenizer_address_line(void)
7289c5600711b45f30fe289ab5b0293b51d87041Timo Sirainen static const char *const input[] = {
7289c5600711b45f30fe289ab5b0293b51d87041Timo Sirainen "@invalid invalid@ abc@example.com, ",
7289c5600711b45f30fe289ab5b0293b51d87041Timo Sirainen "Bar Baz <bar@example.org>, ",
7289c5600711b45f30fe289ab5b0293b51d87041Timo Sirainen "foo@domain, ",
7289c5600711b45f30fe289ab5b0293b51d87041Timo Sirainen "foo@domain Bar Baz <bar@example.org>, "
7289c5600711b45f30fe289ab5b0293b51d87041Timo Sirainen static const char *const expected_output[] = {
7289c5600711b45f30fe289ab5b0293b51d87041Timo Sirainen "invalid", "invalid", "abc", "example", "com", "abc@example.com", "Bar", "Baz",
203bb272804e4394ae07103cdc8ce67041ba21a1Aki Tuomi unsigned int i;
203bb272804e4394ae07103cdc8ce67041ba21a1Aki Tuomi test_begin("fts tokenizer email address + parent, input one line at a time");
203bb272804e4394ae07103cdc8ce67041ba21a1Aki Tuomi test_assert(fts_tokenizer_create(fts_tokenizer_generic, NULL, NULL, &gen_tok, &error) == 0);
203bb272804e4394ae07103cdc8ce67041ba21a1Aki Tuomi test_assert(fts_tokenizer_create(fts_tokenizer_email_address, gen_tok, NULL, &tok, &error) == 0);
203bb272804e4394ae07103cdc8ce67041ba21a1Aki Tuomi fts_tokenizer_next(tok, (unsigned char *)input[i],
559f278a4c54d9fa7e0f2e96ebceda30562f9009Timo Sirainenstatic void test_fts_tokenizer_address_rand(void)
559f278a4c54d9fa7e0f2e96ebceda30562f9009Timo Sirainen static const unsigned char input[] =
559f278a4c54d9fa7e0f2e96ebceda30562f9009Timo Sirainen "@invalid invalid@ abc@example.com, "
9dd1c256910f1fb42823116a641e7edb3ad11970Timo Sirainen "Bar Baz <bar@example.org>, "
9dd1c256910f1fb42823116a641e7edb3ad11970Timo Sirainen "foo@domain";
9dd1c256910f1fb42823116a641e7edb3ad11970Timo Sirainen static const char *const expected_output[] = {
9dd1c256910f1fb42823116a641e7edb3ad11970Timo Sirainen "invalid", "invalid", "abc", "example", "com", "abc@example.com", "Bar", "Baz",
9dd1c256910f1fb42823116a641e7edb3ad11970Timo Sirainen test_begin("fts tokenizer email address + parent, input random length");
9dd1c256910f1fb42823116a641e7edb3ad11970Timo Sirainen fts_tokenizer_register(fts_tokenizer_generic);
d477acb83e14a776ece4ca94dcd1869e75d0c6eeTimo Sirainen fts_tokenizer_register(fts_tokenizer_email_address);
1d22eaac93de41319918a1fc6de42bb302e25c1aTimo Sirainen test_assert(fts_tokenizer_create(fts_tokenizer_generic, NULL, NULL, &gen_tok, &error) == 0);
1d22eaac93de41319918a1fc6de42bb302e25c1aTimo Sirainen test_assert(fts_tokenizer_create(fts_tokenizer_email_address, gen_tok, NULL, &tok, &error) == 0);
5d60e31c7b701b606067a20bc88dcc8a6de7bbd6Timo Sirainen //srand(1424142100); /* had a bug */
2024157e8de36edd31f5fd72f5ea7364a0955fa7Timo Sirainen fts_tokenizer_next(tok, &input[i], step, &token) :
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen fts_tokenizer_unregister(fts_tokenizer_generic);
b215a8a123623782554a83f3025ef4e771bd8f01Timo Sirainen fts_tokenizer_unregister(fts_tokenizer_email_address);
5d60e31c7b701b606067a20bc88dcc8a6de7bbd6Timo Sirainenstatic void test_fts_tokenizer_address_search(void)
32b78da5dfbbf6a06b3dbdc9278c60b55714f9bcTimo Sirainen static const unsigned char input[] =
32b78da5dfbbf6a06b3dbdc9278c60b55714f9bcTimo Sirainen "@invalid invalid@ abc@example.com, "
e9371f899a3d4207a0ffd3923ea5ec7250cf5e75Timo Sirainen "Bar Baz <bar@example.org>, "
32b78da5dfbbf6a06b3dbdc9278c60b55714f9bcTimo Sirainen "foo@domain";
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen static const char *const expected_output[] = {
int ret;
test_assert(fts_tokenizer_create(fts_tokenizer_email_address, gen_tok, settings, &tok, &error) == 0);
if (ret == 0) {
eopp++;
test_end();
int main(void)
static void (*test_functions[])(void) = {