]> git.notmuchmail.org Git - notmuch/blob - test/search-lwn
e7a10b4f1f69bd003e66c899945712036bfbd131
[notmuch] / test / search-lwn
1 #!/bin/bash
2 test_description='searching for messages from lwn.net'
3 . ./test-lib.sh
4
5 add_message \
6   '[from]="LWN.net Weekly Notification <lwn@lwn.net>"' \
7   '[subject]="LWN.net Weekly Edition for January 27, 2011 available"'
8 add_message \
9   '[from]="LWN.net Mailing Lists <lwn@lwn.net>"' \
10   '[subject]="LWN.net newly freed content for January 27, 2011"'
11
12 test_begin_subtest "LWN, I:"
13 output=$(notmuch search from:'lwn.net weekly notification' | notmuch_search_sanitize)
14 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] LWN.net Weekly Notification; LWN.net Weekly Edition for January 27, 2011 available (inbox unread)"
15
16 test_begin_subtest "LWN, II:"
17 output=$(notmuch search from:'lwn.net mailing lists' | notmuch_search_sanitize)
18 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] LWN.net Mailing Lists; LWN.net newly freed content for January 27, 2011 (inbox unread)"
19
20 test_begin_subtest "LWN, III:"
21 output=$(notmuch search from:lwn and from:weekly | notmuch_search_sanitize)
22 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] LWN.net Weekly Notification; LWN.net Weekly Edition for January 27, 2011 available (inbox unread)"
23
24 test_begin_subtest "LWN, IV:"
25 output=$(notmuch search from:lwn and from:mailing | notmuch_search_sanitize)
26 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] LWN.net Mailing Lists; LWN.net newly freed content for January 27, 2011 (inbox unread)"
27
28 test_begin_subtest "LWN, V:"
29 output=$(notmuch search from:lwn@lwn.net and subject:weekly | notmuch_search_sanitize)
30 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] LWN.net Weekly Notification; LWN.net Weekly Edition for January 27, 2011 available (inbox unread)"
31
32 test_begin_subtest "LWN, VI:"
33 output=$(notmuch search from:lwn@lwn.net and subject:mailing | notmuch_search_sanitize)
34 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] LWN.net Mailing Lists; LWN.net newly freed content for January 27, 2011 (inbox unread)"
35
36 test_begin_subtest "LWN, VII:"
37 output=$(notmuch count from:lwn@lwn.net)
38 test_expect_equal "$output" 2
39
40 test_begin_subtest 'Search for all messages ("*")'
41 output=$(notmuch search '*' | notmuch_search_sanitize)
42 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] LWN.net Weekly Notification; LWN.net Weekly Edition for January 27, 2011 available (inbox unread)
43 thread:XXX   2001-01-05 [1/1] LWN.net Mailing Lists; LWN.net newly freed content for January 27, 2011 (inbox unread)"
44
45 test_done