2 test_description="threading when messages received out of order"
5 test_begin_subtest "Adding initial child message"
6 generate_message [body]=foo "[in-reply-to]=\<parent-id\>" [subject]=brokenthreadtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
8 test_expect_equal "$output" "Added 1 new message to the database."
10 test_begin_subtest "Searching returns the message"
11 output=$(notmuch search foo | notmuch_search_sanitize)
12 test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; brokenthreadtest (inbox unread)"
14 test_begin_subtest "Adding second child message"
15 generate_message [body]=foo "[in-reply-to]=\<parent-id\>" [subject]=brokenthreadtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
17 test_expect_equal "$output" "Added 1 new message to the database."
19 test_begin_subtest "Searching returns both messages in one thread"
20 output=$(notmuch search foo | notmuch_search_sanitize)
21 test_expect_equal "$output" "thread:XXX 2000-01-01 [2/2] Notmuch Test Suite; brokenthreadtest (inbox unread)"
23 test_begin_subtest "Adding parent message"
24 generate_message [body]=foo [id]=parent-id [subject]=brokenthreadtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
26 test_expect_equal "$output" "Added 1 new message to the database."
28 test_begin_subtest "Searching returns all three messages in one thread"
29 output=$(notmuch search foo | notmuch_search_sanitize)
30 test_expect_equal "$output" "thread:XXX 2000-01-01 [3/3] Notmuch Test Suite; brokenthreadtest (inbox unread)"