mirror of https://github.com/djcb/mu.git
tests: add unit test for cjk handling
This test exposes some problem finding longer CJK strings; see: issue #1428. The test does not _pass_ yet, so skip it for now.
This commit is contained in:
parent
e8719889d8
commit
3001c7832d
|
@ -0,0 +1,10 @@
|
||||||
|
From: "Bob" <bob@builder.com>
|
||||||
|
Subject: CJK 1
|
||||||
|
To: "Chase" <chase@ppatrol.org>
|
||||||
|
Date: Thu, 18 Nov 2021 08:35:34 +0200
|
||||||
|
Message-Id: 112342343e9dfo.fsf@builder.com
|
||||||
|
User-Agent: mu4e 1.7.5; emacs 29.0.50
|
||||||
|
|
||||||
|
サーバがダウンしました
|
||||||
|
|
||||||
|
https://github.com/djcb/mu/issues/1428
|
|
@ -0,0 +1,10 @@
|
||||||
|
From: "Bob" <bob@builder.com>
|
||||||
|
Subject: CJK 2
|
||||||
|
To: "Chase" <chase@ppatrol.org>
|
||||||
|
Date: Thu, 18 Nov 2021 08:35:34 +0200
|
||||||
|
Message-Id: 271r2342343e9dfo.fsf@builder.com
|
||||||
|
User-Agent: mu4e 1.7.5; emacs 29.0.50
|
||||||
|
|
||||||
|
スポンサーシップ募集
|
||||||
|
|
||||||
|
https://github.com/djcb/mu/issues/1428
|
|
@ -0,0 +1,10 @@
|
||||||
|
From: "Bob" <bob@builder.com>
|
||||||
|
Subject: CJK 3
|
||||||
|
To: "Chase" <chase@ppatrol.org>
|
||||||
|
Date: Thu, 18 Nov 2021 08:35:34 +0200
|
||||||
|
Message-Id: 3871r2342343e9dfo.fsf@builder.com
|
||||||
|
User-Agent: mu4e 1.7.5; emacs 29.0.50
|
||||||
|
|
||||||
|
サービス開始について
|
||||||
|
|
||||||
|
https://github.com/djcb/mu/issues/1428
|
|
@ -0,0 +1,10 @@
|
||||||
|
From: "Bob" <bob@builder.com>
|
||||||
|
Subject: CJK 4
|
||||||
|
To: "Chase" <chase@ppatrol.org>
|
||||||
|
Date: Thu, 18 Nov 2021 08:35:34 +0200
|
||||||
|
Message-Id: 4871r2342343e9dfo.fsf@builder.com
|
||||||
|
User-Agent: mu4e 1.7.5; emacs 29.0.50
|
||||||
|
|
||||||
|
ショルダーバック
|
||||||
|
|
||||||
|
https://github.com/djcb/mu/issues/1428
|
|
@ -100,6 +100,7 @@ testmaildir=join_paths(meson.current_source_dir(), 'lib', 'tests')
|
||||||
config_h_data.set_quoted('MU_TESTMAILDIR', join_paths(testmaildir, 'testdir'))
|
config_h_data.set_quoted('MU_TESTMAILDIR', join_paths(testmaildir, 'testdir'))
|
||||||
config_h_data.set_quoted('MU_TESTMAILDIR2', join_paths(testmaildir, 'testdir2'))
|
config_h_data.set_quoted('MU_TESTMAILDIR2', join_paths(testmaildir, 'testdir2'))
|
||||||
config_h_data.set_quoted('MU_TESTMAILDIR4', join_paths(testmaildir, 'testdir4'))
|
config_h_data.set_quoted('MU_TESTMAILDIR4', join_paths(testmaildir, 'testdir4'))
|
||||||
|
config_h_data.set_quoted('MU_TESTMAILDIR_CJK', join_paths(testmaildir, 'cjk'))
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# hard dependencies
|
# hard dependencies
|
||||||
|
|
|
@ -559,6 +559,43 @@ test_mu_query_threads_compilation_error(void)
|
||||||
3);
|
3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* https://github.com/djcb/mu/issues/1428 */
|
||||||
|
static void
|
||||||
|
test_mu_query_cjk(void)
|
||||||
|
{
|
||||||
|
/* XXX: this doesn't pass yet; return for now */
|
||||||
|
g_test_skip("skip CJK tests");
|
||||||
|
return;
|
||||||
|
|
||||||
|
{
|
||||||
|
g_unsetenv("XAPIAN_CJK_NGRAM");
|
||||||
|
const auto xpath = make_database(MU_TESTMAILDIR_CJK);
|
||||||
|
g_assert_cmpuint(run_and_count_matches(xpath,
|
||||||
|
"サーバがダウンしました",
|
||||||
|
QueryFlags::None),
|
||||||
|
==, 1);
|
||||||
|
g_assert_cmpuint(run_and_count_matches(xpath,
|
||||||
|
"サーバ",
|
||||||
|
QueryFlags::None),
|
||||||
|
==, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
g_setenv("XAPIAN_CJK_NGRAM", "1", TRUE);
|
||||||
|
const auto xpath = make_database(MU_TESTMAILDIR_CJK);
|
||||||
|
g_assert_cmpuint(run_and_count_matches(xpath,
|
||||||
|
"サーバがダウンしました",
|
||||||
|
QueryFlags::None),
|
||||||
|
==, 0);
|
||||||
|
g_assert_cmpuint(run_and_count_matches(xpath,
|
||||||
|
"サーバ",
|
||||||
|
QueryFlags::None),
|
||||||
|
==, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char* argv[])
|
main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
@ -608,6 +645,9 @@ main(int argc, char* argv[])
|
||||||
g_test_add_func("/mu-query/test-mu-query-threads-compilation-error",
|
g_test_add_func("/mu-query/test-mu-query-threads-compilation-error",
|
||||||
test_mu_query_threads_compilation_error);
|
test_mu_query_threads_compilation_error);
|
||||||
|
|
||||||
|
g_test_add_func("/mu-query/test-mu-query-cjk",
|
||||||
|
test_mu_query_cjk);
|
||||||
|
|
||||||
if (!g_test_verbose())
|
if (!g_test_verbose())
|
||||||
g_log_set_handler(NULL,
|
g_log_set_handler(NULL,
|
||||||
(GLogLevelFlags)(G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL |
|
(GLogLevelFlags)(G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL |
|
||||||
|
|
Loading…
Reference in New Issue