]> git.notmuchmail.org Git - notmuch/blob - test/emacs-tree
emacs: tree: remove test for emacs from tree test
[notmuch] / test / emacs-tree
1 #!/usr/bin/env bash
2
3 test_description="emacs tree view interface"
4 . test-lib.sh
5
6 EXPECTED=$TEST_DIRECTORY/tree.expected-output
7
8 add_email_corpus
9
10 test_begin_subtest "Basic notmuch-tree view in emacs"
11 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
12             (require (quote notmuch-tree))
13             (notmuch-tree "tag:inbox")
14             (notmuch-test-wait)
15             (test-output)
16             (delete-other-windows)'
17 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox
18
19 test_begin_subtest "Refreshed notmuch-tree view in emacs"
20 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
21             (require (quote notmuch-tree))
22             (notmuch-tree "tag:inbox")
23             (notmuch-test-wait)
24             (notmuch-tree-refresh-view)
25             (notmuch-test-wait)
26             (test-output)
27             (delete-other-windows)'
28 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox
29
30 # In the following tag tests we make sure the display is updated
31 # correctly and, in a separate test, that the database is updated
32 # correctly.
33
34 test_begin_subtest "Tag message in notmuch tree view (display)"
35 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
36             (require (quote notmuch-tree))
37             (notmuch-tree "tag:inbox")
38             (notmuch-test-wait)
39             (forward-line)
40             (notmuch-tree-tag (list "+test_tag"))
41             (test-output)
42             (delete-other-windows)'
43 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox-tagged
44
45 test_begin_subtest "Tag message in notmuch tree view (database)"
46 output=$(notmuch search --output=messages 'tag:test_tag')
47 test_expect_equal "$output" "id:877h1wv7mg.fsf@inf-8657.int-evry.fr"
48
49 test_begin_subtest "Untag message in notmuch tree view"
50 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
51             (require (quote notmuch-tree))
52             (notmuch-tree "tag:inbox")
53             (notmuch-test-wait)
54             (forward-line)
55             (notmuch-tree-tag (list "-test_tag"))
56             (test-output)
57             (delete-other-windows)'
58 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox
59
60 test_begin_subtest "Untag message in notmuch tree view (database)"
61 output=$(notmuch search --output=messages 'tag:test_tag')
62 test_expect_equal "$output" ""
63
64 test_begin_subtest "Tag thread in notmuch tree view"
65 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
66             (require (quote notmuch-tree))
67             (notmuch-tree "tag:inbox")
68             (notmuch-test-wait)
69             ;; move to a sizable thread
70             (forward-line 26)
71             (notmuch-tree-tag-thread (list "+test_thread_tag"))
72             (test-output)
73             (delete-other-windows)'
74 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox-thread-tagged
75
76 test_begin_subtest "Tag message in notmuch tree view (database)"
77 output=$(notmuch search --output=messages 'tag:test_thread_tag')
78 test_expect_equal "$output" \
79 "id:87ocn0qh6d.fsf@yoom.home.cworth.org
80 id:20091118005040.GA25380@dottiness.seas.harvard.edu
81 id:yunaayketfm.fsf@aiko.keithp.com
82 id:87fx8can9z.fsf@vertex.dottedmag
83 id:20091117203301.GV3165@dottiness.seas.harvard.edu
84 id:87iqd9rn3l.fsf@vertex.dottedmag
85 id:20091117190054.GU3165@dottiness.seas.harvard.edu"
86
87 test_begin_subtest "Untag thread in notmuch tree view"
88 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
89             (require (quote notmuch-tree))
90             (notmuch-tree "tag:inbox")
91             (notmuch-test-wait)
92             ;; move to the same sizable thread as above
93             (forward-line 26)
94             (notmuch-tree-tag-thread (list "-test_thread_tag"))
95             (test-output)
96             (delete-other-windows)'
97 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox
98
99 test_begin_subtest "Untag message in notmuch tree view (database)"
100 output=$(notmuch search --output=messages 'tag:test_thread_tag')
101 test_expect_equal "$output" ""
102
103 test_begin_subtest "Navigation of notmuch-hello to search results"
104 test_emacs '(notmuch-hello)
105             (goto-char (point-min))
106             (re-search-forward "inbox")
107             (widget-button-press (1- (point)))
108             (notmuch-test-wait)
109             (notmuch-tree-from-search-current-query)
110             (notmuch-test-wait)
111             (test-output)
112             (delete-other-windows)'
113 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox
114
115 test_begin_subtest "Tree view of a single thread (from search)"
116 test_emacs '(notmuch-hello)
117             (goto-char (point-min))
118             (re-search-forward "inbox")
119             (widget-button-press (1- (point)))
120             (notmuch-test-wait)
121             (notmuch-tree-from-search-thread)
122             (notmuch-test-wait)
123             (test-output)
124             (delete-other-windows)'
125 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-single-thread
126
127 test_begin_subtest "Tree view of a single thread (from show)"
128 test_emacs '(notmuch-hello)
129             (goto-char (point-min))
130             (re-search-forward "inbox")
131             (widget-button-press (1- (point)))
132             (notmuch-test-wait)
133             (notmuch-search-show-thread)
134             (notmuch-tree-from-show-current-query)
135             (notmuch-test-wait)
136             (test-output)
137             (delete-other-windows)'
138 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-single-thread
139
140 test_begin_subtest "Message window of tree view"
141 test_emacs '(notmuch-hello)
142             (goto-char (point-min))
143             (re-search-forward "inbox")
144             (widget-button-press (1- (point)))
145             (notmuch-test-wait)
146             (notmuch-search-next-thread)
147             (notmuch-tree-from-search-thread)
148             (notmuch-test-wait)
149             (select-window notmuch-tree-message-window)
150             (test-output)
151             (delete-other-windows)'
152 cp OUTPUT /tmp/mjwout
153 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-show-window
154
155 test_begin_subtest "Stash id"
156 output=$(test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
157                      (require (quote notmuch-tree))
158                      (notmuch-tree "id:1258498485-sup-142@elly")
159                      (notmuch-test-wait)
160                      (notmuch-show-stash-message-id)')
161 test_expect_equal "$output" "\"Stashed: id:1258498485-sup-142@elly\""
162
163 test_begin_subtest "Move to next matching message"
164 output=$(test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
165                      (require (quote notmuch-tree))
166                      (notmuch-tree "from:cworth")
167                      (notmuch-test-wait)
168                      (notmuch-tree-next-matching-message)
169                      (notmuch-show-stash-message-id)')
170 test_expect_equal "$output" "\"Stashed: id:878we4qdqf.fsf@yoom.home.cworth.org\""
171
172 test_begin_subtest "Move to next thread"
173 output=$(test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
174                      (require (quote notmuch-tree))
175                      (notmuch-tree "tag:inbox")
176                      (notmuch-test-wait)
177                      (forward-line 26)
178                      (notmuch-tree-next-thread)
179                      (notmuch-show-stash-message-id)')
180 test_expect_equal "$output" "\"Stashed: id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net\""
181
182 test_begin_subtest "Move to previous thread"
183 output=$(test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
184                      (require (quote notmuch-tree))
185                      (notmuch-tree "tag:inbox")
186                      (notmuch-test-wait)
187                      (forward-line 26)
188                      (notmuch-tree-prev-thread)
189                      (notmuch-show-stash-message-id)')
190 test_expect_equal "$output" "\"Stashed: id:20091117190054.GU3165@dottiness.seas.harvard.edu\""
191
192 test_begin_subtest "Move to previous previous thread"
193 output=$(test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
194                      (require (quote notmuch-tree))
195                      (notmuch-tree "tag:inbox")
196                      (notmuch-test-wait)
197                      (forward-line 26)
198                      (notmuch-tree-prev-thread)
199                      (notmuch-tree-prev-thread)
200                      (notmuch-show-stash-message-id)')
201 test_expect_equal "$output" "\"Stashed: id:1258493565-13508-1-git-send-email-keithp@keithp.com\""
202
203 test_done