unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 3c2642dad31fb536daa318642f2ad03671262752 3494 bytes (raw)
name: test/T461-emacs-search-exclude.sh 	 # note: path name is non-authoritative(*)

 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
 
#!/usr/bin/env bash

test_description="exclude options persist between Emacs search and tree modes"
. $(dirname "$0")/test-lib.sh || exit 1
. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1

EXPECTED=$NOTMUCH_SRCDIR/test/emacs-exclude.expected-output

test_require_emacs
add_email_corpus
notmuch config set search.exclude_tags deleted
notmuch tag +deleted -- 'from:"Stewart Smith"' or 'from:"Chris Wilson"'

# Basic test cases just asserting exclude option is working and consistent.

test_begin_subtest "Search doesn't contain excluded mail by default"
test_emacs '(notmuch-hello)
	    (goto-char (point-min))
	    (re-search-forward "inbox")
	    (widget-button-press (1- (point)))
	    (notmuch-test-wait)
	    (test-output)
	    (delete-other-windows)'
test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox-without-excluded OUTPUT

test_begin_subtest "Toggling exclude in search will show excluded mail"
test_emacs '(notmuch-hello)
	    (goto-char (point-min))
	    (re-search-forward "inbox")
	    (widget-button-press (1- (point)))
	    (notmuch-test-wait)
      (notmuch-search-toggle-exclude)
	    (notmuch-test-wait)
	    (test-output)
	    (delete-other-windows)'
test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox-with-excluded OUTPUT

test_begin_subtest "Tree search doesn't contain excluded mail by default"
test_emacs '(notmuch-hello)
	    (goto-char (point-min))
	    (re-search-forward "inbox")
	    (widget-button-press (1- (point)))
	    (notmuch-test-wait)
	    (notmuch-tree-from-search-current-query)
	    (notmuch-test-wait)
	    (test-output)
	    (delete-other-windows)'
test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox-without-excluded OUTPUT

test_begin_subtest "Toggling exclude in tree search will show excluded mail"
test_emacs '(notmuch-hello)
	    (goto-char (point-min))
	    (re-search-forward "inbox")
	    (widget-button-press (1- (point)))
	    (notmuch-test-wait)
	    (notmuch-tree-from-search-current-query)
	    (notmuch-test-wait)
      (notmuch-tree-toggle-exclude)
	    (notmuch-test-wait)
	    (test-output)
	    (delete-other-windows)'
test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox-with-excluded OUTPUT

# Choice of showing excluded mail persists when switching between tree and search
# buffers.

test_begin_subtest "Value of exclude from search persists into tree search"
test_emacs '(notmuch-hello)
	    (goto-char (point-min))
	    (re-search-forward "inbox")
	    (widget-button-press (1- (point)))
	    (notmuch-test-wait)
      (notmuch-search-toggle-exclude)
	    (notmuch-test-wait)
	    (notmuch-tree-from-search-current-query)
	    (notmuch-test-wait)
	    (test-output)
	    (delete-other-windows)'
test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox-with-excluded OUTPUT

test_begin_subtest "Value of exclude from tree persists into search search"
test_emacs '(notmuch-hello)
	    (goto-char (point-min))
	    (re-search-forward "inbox")
	    (widget-button-press (1- (point)))
	    (notmuch-test-wait)
	    (notmuch-tree-from-search-current-query)
	    (notmuch-test-wait)
      (notmuch-tree-toggle-exclude)
	    (notmuch-test-wait)
	    (notmuch-search-from-tree-current-query)
	    (notmuch-test-wait)
	    (test-output)
	    (delete-other-windows)'
test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox-with-excluded OUTPUT

# TODO: Add test cases for unthreaded conversions as well.

test_done

debug log:

solving bf558847 ...
found bf558847 in https://yhetil.org/notmuch/20220807145733.129867-6-mohkale@kisara.moe/ ||
	https://yhetil.org/notmuch/87ilnmw7kf.fsf@kisara.moe/

applying [1/1] https://yhetil.org/notmuch/20220807145733.129867-6-mohkale@kisara.moe/
diff --git a/test/T461-emacs-search-exclude.sh b/test/T461-emacs-search-exclude.sh\r
new file mode 100755\r
index 00000000..bf558847\r

1:7: trailing whitespace.
#!/usr/bin/env bash\r
1:8: trailing whitespace.
\r
1:9: trailing whitespace.
test_description="exclude options persist between Emacs search and tree modes"\r
1:10: trailing whitespace.
. $(dirname "$0")/test-lib.sh || exit 1\r
1:11: trailing whitespace.
. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1\r
Checking patch test/T461-emacs-search-exclude.sh...
Applied patch test/T461-emacs-search-exclude.sh cleanly.
warning: squelched 94 whitespace errors
warning: 99 lines add whitespace errors.

skipping https://yhetil.org/notmuch/87ilnmw7kf.fsf@kisara.moe/ for bf558847
index at:
100755 3c2642dad31fb536daa318642f2ad03671262752	test/T461-emacs-search-exclude.sh

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).