mirror of https://github.com/djcb/mu.git
tests: threads: Test if 2nd child message promotes its subthread
This commit is contained in:
parent
22927a7dcf
commit
c5d4f7f338
|
@ -0,0 +1,7 @@
|
|||
From: testfrom@example.com
|
||||
To: testto@example.com
|
||||
Subject: A
|
||||
Message-Id: <A@msg.id>
|
||||
Date: Sat, 17 May 2014 10:00:00 +0000
|
||||
|
||||
A
|
|
@ -0,0 +1,7 @@
|
|||
From: testfrom@example.com
|
||||
To: testto@example.com
|
||||
Subject: B
|
||||
Message-Id: <B@msg.id>
|
||||
Date: Sat, 17 May 2014 10:00:00 +0000
|
||||
|
||||
B
|
|
@ -0,0 +1,9 @@
|
|||
From: testfrom@example.com
|
||||
To: testto@example.com
|
||||
Subject: C
|
||||
Message-Id: <C@msg.id>
|
||||
References: <B@msg.id>
|
||||
In-reply-to: <B@msg.id>
|
||||
Date: Sat, 17 May 2014 10:00:00 +0000
|
||||
|
||||
C
|
|
@ -0,0 +1,7 @@
|
|||
From: testfrom@example.com
|
||||
To: testto@example.com
|
||||
Subject: D
|
||||
Message-Id: <D@msg.id>
|
||||
Date: Sat, 17 May 2014 10:00:00 +0000
|
||||
|
||||
D
|
|
@ -0,0 +1,9 @@
|
|||
From: testfrom@example.com
|
||||
To: testto@example.com
|
||||
Subject: E
|
||||
Message-Id: <E@msg.id>
|
||||
References: <B@msg.id>
|
||||
In-reply-to: <B@msg.id>
|
||||
Date: Sat, 17 May 2014 10:00:00 +0000
|
||||
|
||||
E
|
|
@ -295,6 +295,31 @@ test_mu_threads_sort_1st_child_promotes_thread (void)
|
|||
G_N_ELEMENTS (expected_desc));
|
||||
}
|
||||
|
||||
static void
|
||||
test_mu_threads_sort_2nd_child_promotes_thread (void)
|
||||
{
|
||||
const char *query = "maildir:/sort/2nd-child-promotes-thread";
|
||||
|
||||
const tinfo expected_asc [] = {
|
||||
{ "0", "A@msg.id", "A"},
|
||||
{ "1", "D@msg.id", "D"},
|
||||
{ "2", "B@msg.id", "B"},
|
||||
{ "2:0", "C@msg.id", "C"},
|
||||
{ "2:1", "E@msg.id", "E"},
|
||||
};
|
||||
const tinfo expected_desc [] = {
|
||||
{ "0", "B@msg.id", "B"},
|
||||
{ "0:0", "E@msg.id", "E"},
|
||||
{ "0:1", "C@msg.id", "C"},
|
||||
{ "1", "D@msg.id", "D"},
|
||||
{ "2", "A@msg.id", "A"},
|
||||
};
|
||||
|
||||
check_sort_by_subject_asc (query, expected_asc,
|
||||
G_N_ELEMENTS (expected_asc));
|
||||
check_sort_by_subject_desc (query, expected_desc,
|
||||
G_N_ELEMENTS (expected_desc));
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
|
@ -307,6 +332,8 @@ main (int argc, char *argv[])
|
|||
g_test_add_func ("/mu-query/test-mu-threads-rogue", test_mu_threads_rogue);
|
||||
g_test_add_func ("/mu-query/test-mu-threads-sort-1st-child-promotes-thread",
|
||||
test_mu_threads_sort_1st_child_promotes_thread);
|
||||
g_test_add_func ("/mu-query/test-mu-threads-sort-2nd-child-promotes-thread",
|
||||
test_mu_threads_sort_2nd_child_promotes_thread);
|
||||
|
||||
g_log_set_handler (NULL,
|
||||
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,
|
||||
|
|
Loading…
Reference in New Issue