]> git.notmuchmail.org Git - notmuch/blob - test/T120-search-insufficient-from-quoting.sh
Import notmuch_0.27.orig.tar.gz
[notmuch] / test / T120-search-insufficient-from-quoting.sh
1 #!/usr/bin/env bash
2 test_description='messages with unquoted . in name'
3 . $(dirname "$0")/test-lib.sh || exit 1
4
5 add_message \
6   '[from]="Some.Name for Someone <bugs@quoting.com>"' \
7   '[subject]="This message needs more quoting on the From line"'
8
9 add_message \
10   '[from]="\"Some.Name for Someone\" <bugs@quoting.com>"' \
11   '[subject]="This message has necessary quoting in place"'
12
13 add_message \
14   '[from]="No.match Here <filler@mail.com>"' \
15   '[subject]="This message needs more quoting on the From line"'
16
17 add_message \
18   '[from]="\"No.match Here\" <filler@mail.com>"' \
19   '[subject]="This message has necessary quoting in place"'
20
21
22 test_begin_subtest "Search by first name"
23 output=$(notmuch search from:Some.Name | notmuch_search_sanitize)
24 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Some.Name for Someone; This message needs more quoting on the From line (inbox unread)
25 thread:XXX   2001-01-05 [1/1] Some.Name for Someone; This message has necessary quoting in place (inbox unread)"
26
27 test_begin_subtest "Search by last name:"
28 output=$(notmuch search from:Someone | notmuch_search_sanitize)
29 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Some.Name for Someone; This message needs more quoting on the From line (inbox unread)
30 thread:XXX   2001-01-05 [1/1] Some.Name for Someone; This message has necessary quoting in place (inbox unread)"
31
32 test_begin_subtest "Search by address:"
33 output=$(notmuch search from:bugs@quoting.com | notmuch_search_sanitize)
34 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Some.Name for Someone; This message needs more quoting on the From line (inbox unread)
35 thread:XXX   2001-01-05 [1/1] Some.Name for Someone; This message has necessary quoting in place (inbox unread)"
36
37 test_begin_subtest "Search for all messages:"
38 output=$(notmuch search '*' | notmuch_search_sanitize)
39 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Some.Name for Someone; This message needs more quoting on the From line (inbox unread)
40 thread:XXX   2001-01-05 [1/1] Some.Name for Someone; This message has necessary quoting in place (inbox unread)
41 thread:XXX   2001-01-05 [1/1] No.match Here; This message needs more quoting on the From line (inbox unread)
42 thread:XXX   2001-01-05 [1/1] No.match Here; This message has necessary quoting in place (inbox unread)"
43
44 test_done