From 16180ced2a364ede9ccfdcd2c92cc98323d4193e Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Wed, 18 May 2011 00:00:10 +0300 Subject: [PATCH] * tests/: add tests for issues mentioned in issue #38 (http://code.google.com/p/mu0/issues/detail?id=38). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cannot reproduce the issue though, except when searching for the 'From:' -- this seems to be due to limitation with GMime, if I do: mu view testdir/cur/1305664394.2171_402.cthulhu\!2, get: ------------------------------- From: Mü To: Helmut =?iso-8859-1?q?Kr=F6ger?= Subject: Motörhead Test for issue #38, where apparently searching for accented words in subject, to etc. fails. What about here? Queensrÿche. Mötley Crüe. ------------------------------- They decoding issues are of course very mail-client specific. --- src/tests/Makefile.am | 1 + src/tests/test-mu-maildir.c | 4 +-- src/tests/test-mu-query.c | 32 +++++++++++++++++-- .../cur/1305664394.2171_402.cthulhu!2, | 15 +++++++++ 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 src/tests/testdir/cur/1305664394.2171_402.cthulhu!2, diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index fa569531..399ea3f8 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -101,6 +101,7 @@ EXTRA_DIST= \ testdir/cur/1220863042.12663_1.mindcrime!2,S \ testdir/cur/1220863060.12663_3.mindcrime!2,S \ testdir/cur/1283599333.1840_11.cthulhu!2, \ + testdir/cur/1305664394.2171_402.cthulhu!2, \ testdir2/bar/cur/mail1 \ testdir2/bar/cur/mail2 \ testdir2/bar/cur/mail3 \ diff --git a/src/tests/test-mu-maildir.c b/src/tests/test-mu-maildir.c index 94174b51..e3733395 100644 --- a/src/tests/test-mu-maildir.c +++ b/src/tests/test-mu-maildir.c @@ -189,7 +189,7 @@ test_mu_maildir_walk_01 (void) &data); g_assert_cmpuint (MU_OK, ==, rv); - g_assert_cmpuint (data._file_count, ==, 11); + g_assert_cmpuint (data._file_count, ==, 12); g_assert_cmpuint (data._dir_entered,==, 5); g_assert_cmpuint (data._dir_left,==, 5); @@ -220,7 +220,7 @@ test_mu_maildir_walk_02 (void) &data); g_assert_cmpuint (MU_OK, ==, rv); - g_assert_cmpuint (data._file_count, ==, 7); + g_assert_cmpuint (data._file_count, ==, 8); g_assert_cmpuint (data._dir_entered,==, 4); g_assert_cmpuint (data._dir_left,==, 4); diff --git a/src/tests/test-mu-query.c b/src/tests/test-mu-query.c index f9424830..50c20bc7 100644 --- a/src/tests/test-mu-query.c +++ b/src/tests/test-mu-query.c @@ -187,10 +187,10 @@ test_mu_query_04 (void) { "f:bilbo", 0}, { "baggins", 1}, { "prio:high", 1}, - { "prio:normal", 3}, + { "prio:normal", 4}, { "prio:h", 1}, { "prio:l", 7}, - { "not prio:l", 4} + { "not prio:l", 5}, }; xpath = fill_database (); @@ -243,6 +243,33 @@ test_mu_query_05 (void) } + +static void +test_mu_query_06 (void) +{ + gchar *xpath; + int i; + + QResults queries[] = { + { "f:mü", 1}, + { "s:motörhead", 1}, + { "s:MotorHeäD", 1}, + { "queensryche", 1}, + { "Queensrÿche", 1}, + }; + + xpath = fill_database (); + g_assert (xpath != NULL); + + for (i = 0; i != G_N_ELEMENTS(queries); ++i) + g_assert_cmpuint (run_and_count_matches (xpath, queries[i].query), + ==, queries[i].count); + g_free (xpath); + +} + + + int main (int argc, char *argv[]) { @@ -254,6 +281,7 @@ main (int argc, char *argv[]) g_test_add_func ("/mu-query/test-mu-query-03", test_mu_query_03); g_test_add_func ("/mu-query/test-mu-query-04", test_mu_query_04); g_test_add_func ("/mu-query/test-mu-query-05", test_mu_query_05); + g_test_add_func ("/mu-query/test-mu-query-06", test_mu_query_06); /* g_log_set_handler (NULL, */ /* G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION, */ diff --git a/src/tests/testdir/cur/1305664394.2171_402.cthulhu!2, b/src/tests/testdir/cur/1305664394.2171_402.cthulhu!2, new file mode 100644 index 00000000..cea827fb --- /dev/null +++ b/src/tests/testdir/cur/1305664394.2171_402.cthulhu!2, @@ -0,0 +1,15 @@ +From: =?UTF-8?B?TcO8?= +To: Helmut =?UTF-8?B?S3LDtmdlcg==?= +Subject: =?UTF-8?B?TW90w7ZyaGVhZA==?= +User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/24.0 Mule/6.0 (HANACHIRUSATO) +MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + + +Test for issue #38, where apparently searching for accented words in subject, +to etc. fails. + +What about here? Queensrÿche. Mötley Crüe. + +