File: T120-search-insufficient-from-quoting.sh

package info (click to toggle)
notmuch 0.39-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,104 kB
  • sloc: sh: 21,888; ansic: 14,897; lisp: 9,061; cpp: 7,990; python: 6,221; perl: 391; makefile: 231; javascript: 34; ruby: 13
file content (44 lines) | stat: -rwxr-xr-x 2,329 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
test_description='messages with unquoted . in name'
. $(dirname "$0")/test-lib.sh || exit 1

add_message \
  '[from]="Some.Name for Someone <bugs@quoting.com>"' \
  '[subject]="This message needs more quoting on the From line"'

add_message \
  '[from]="\"Some.Name for Someone\" <bugs@quoting.com>"' \
  '[subject]="This message has necessary quoting in place"'

add_message \
  '[from]="No.match Here <filler@mail.com>"' \
  '[subject]="This message needs more quoting on the From line"'

add_message \
  '[from]="\"No.match Here\" <filler@mail.com>"' \
  '[subject]="This message has necessary quoting in place"'


test_begin_subtest "Search by first name"
output=$(notmuch search from:Some.Name | notmuch_search_sanitize)
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)
thread:XXX   2001-01-05 [1/1] Some.Name for Someone; This message has necessary quoting in place (inbox unread)"

test_begin_subtest "Search by last name:"
output=$(notmuch search from:Someone | notmuch_search_sanitize)
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)
thread:XXX   2001-01-05 [1/1] Some.Name for Someone; This message has necessary quoting in place (inbox unread)"

test_begin_subtest "Search by address:"
output=$(notmuch search from:bugs@quoting.com | notmuch_search_sanitize)
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)
thread:XXX   2001-01-05 [1/1] Some.Name for Someone; This message has necessary quoting in place (inbox unread)"

test_begin_subtest "Search for all messages:"
output=$(notmuch search '*' | notmuch_search_sanitize)
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)
thread:XXX   2001-01-05 [1/1] Some.Name for Someone; This message has necessary quoting in place (inbox unread)
thread:XXX   2001-01-05 [1/1] No.match Here; This message needs more quoting on the From line (inbox unread)
thread:XXX   2001-01-05 [1/1] No.match Here; This message has necessary quoting in place (inbox unread)"

test_done