summaryrefslogtreecommitdiff
path: root/src/tests/test-mu-query.c
diff options
context:
space:
mode:
authorDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2011-05-18 00:00:10 +0300
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2011-05-18 00:39:52 +0300
commit16180ced2a364ede9ccfdcd2c92cc98323d4193e (patch)
treeb177dade7e1c6a574120ef1920f7ff0d895e26bc /src/tests/test-mu-query.c
parent8d3fe856528b4d8983936742ef26dfe311434175 (diff)
* tests/: add tests for issues mentioned in issue #38
(http://code.google.com/p/mu0/issues/detail?id=38). 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ü <testmu@testmu.xx> To: Helmut =?iso-8859-1?q?Kr=F6ger?= <hk@testmu.xxx> 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.
Diffstat (limited to 'src/tests/test-mu-query.c')
-rw-r--r--src/tests/test-mu-query.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/tests/test-mu-query.c b/src/tests/test-mu-query.c
index f942483..50c20bc 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, */