]> git.notmuchmail.org Git - notmuch/blob - test/thread-order
test: expand regex in test/basic
[notmuch] / test / thread-order
1 #!/usr/bin/env bash
2 test_description="threading when messages received out of order"
3 . ./test-lib.sh
4
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"'
7 output=$(NOTMUCH_NEW)
8 test_expect_equal "$output" "Added 1 new message to the database."
9
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)"
13
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"'
16 output=$(NOTMUCH_NEW)
17 test_expect_equal "$output" "Added 1 new message to the database."
18
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)"
22
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"'
25 output=$(NOTMUCH_NEW)
26 test_expect_equal "$output" "Added 1 new message to the database."
27
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)"
31
32 test_done