]> git.notmuchmail.org Git - notmuch/blob - test/t0008-threading-out-of-order.sh
test: Fix test suite to integrate with our non-recursive Makefile system.
[notmuch] / test / t0008-threading-out-of-order.sh
1 #!/bin/bash
2 test_description="threading when messages received out of order"
3 . ./test-lib.sh
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."
8 '
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)"
12 '
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."
17 '
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)"
21 '
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."
26 '
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)"
30 '
31 test_done