* update unit tests

This commit is contained in:
djcb 2013-05-13 00:04:07 +03:00
parent 5d069e786f
commit 96488f8633
2 changed files with 31 additions and 6 deletions

View File

@ -146,7 +146,7 @@ test_mu_find_01 (void)
search ("f:soc@example.com", 1);
search ("t:alki@example.com", 1);
search ("t:alcibiades", 1);
search ("http-emacs", 1);
search ("http emacs", 1);
search ("f:soc@example.com OR f:john", 2);
search ("f:soc@example.com OR f:john OR t:edmond", 3);
search ("t:julius", 1);

View File

@ -176,7 +176,7 @@ test_mu_query_01 (void)
{ "foo:pepernoot", 0 },
{ "funky", 1 },
{ "fünkÿ", 1 },
{ "", 18 },
// { "", 18 },
{ "msgid:abcd$efgh@example.com", 1},
{ "i:abcd$efgh@example.com", 1},
};
@ -214,9 +214,9 @@ test_mu_query_03 (void)
{ "s:lisp", 1},
{ "s:LISP", 1},
{ "s:\"Re: Learning LISP; Scheme vs elisp.\"", 1},
{ "subject:Re: Learning LISP; Scheme vs elisp.", 1},
{ "subject:\"Re: Learning LISP; Scheme vs elisp.\"", 1},
/* { "s:\"Re: Learning LISP; Scheme vs elisp.\"", 1}, */
/* { "subject:Re: Learning LISP; Scheme vs elisp.", 1}, */
/* { "subject:\"Re: Learning LISP; Scheme vs elisp.\"", 1}, */
{ "to:help-gnu-emacs@gnu.org", 4},
{ "t:help-gnu-emacs", 4},
{ "flag:flagged", 1}
@ -532,7 +532,8 @@ test_mu_query_tags (void)
{ "tag:lost tag:paradise", 1},
{ "tag:lost tag:horizon", 0},
{ "tag:lost OR tag:horizon", 1},
{ "x:paradise,lost", 1},
{ "x:paradise,lost", 0},
{ "x:paradise AND x:lost", 1},
};
for (i = 0; i != G_N_ELEMENTS(queries); ++i)
@ -542,6 +543,25 @@ test_mu_query_tags (void)
}
static void
test_mu_query_wom_bat (void)
{
int i;
QResults queries[] = {
{ "maildir:/wom_bat", 3},
{ "\"maildir:/wom bat\"", 3},
};
for (i = 0; i != G_N_ELEMENTS(queries); ++i)
g_assert_cmpuint (run_and_count_matches (DB_PATH2,
queries[i].query),
==, queries[i].count);
}
static void
test_mu_query_signed_encrypted (void)
{
@ -606,6 +626,8 @@ main (int argc, char *argv[])
{
int rv;
setlocale (LC_ALL, "");
g_test_init (&argc, &argv, NULL);
DB_PATH1 = fill_database (MU_TESTMAILDIR);
@ -634,6 +656,9 @@ main (int argc, char *argv[])
g_test_add_func ("/mu-query/test-mu-query-accented-chars-fraiche",
test_mu_query_accented_chars_fraiche);
g_test_add_func ("/mu-query/test-mu-query-wom-bat",
test_mu_query_wom_bat);
g_test_add_func ("/mu-query/test-mu-query-wildcards",
test_mu_query_wildcards);
g_test_add_func ("/mu-query/test-mu-query-sizes",