2 test_description="threading when messages received out of order"
4 test_expect_success "Adding initial child message" '
5 generate_message [body]=foo "[in-reply-to]=\<parent-id\>" [subject]=brokenthreadtest "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" &&
6 output=$(NOTMUCH_NEW) &&
7 pass_if_equal "$output" "Added 1 new message to the database."
9 test_expect_success "Searching returns the message" '
10 output=$($NOTMUCH search foo | notmuch_search_sanitize) &&
11 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; brokenthreadtest (inbox unread)"
13 test_expect_success "Adding second child message" '
14 generate_message [body]=foo "[in-reply-to]=\<parent-id\>" [subject]=brokenthreadtest "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" &&
15 output=$(NOTMUCH_NEW) &&
16 pass_if_equal "$output" "Added 1 new message to the database."
18 test_expect_success "Searching returns both messages in one thread" '
19 output=$($NOTMUCH search foo | notmuch_search_sanitize) &&
20 pass_if_equal "$output" "thread:XXX 2000-01-01 [2/2] Notmuch Test Suite; brokenthreadtest (inbox unread)"
22 test_expect_success "Adding parent message" '
23 generate_message [body]=foo [id]=parent-id [subject]=brokenthreadtest "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" &&
24 output=$(NOTMUCH_NEW) &&
25 pass_if_equal "$output" "Added 1 new message to the database."
27 test_expect_success "Searching returns all three messages in one thread" '
28 output=$($NOTMUCH search foo | notmuch_search_sanitize) &&
29 pass_if_equal "$output" "thread:XXX 2000-01-01 [3/3] Notmuch Test Suite; brokenthreadtest (inbox unread)"