3 test_description="emacs tree view interface"
6 EXPECTED=$TEST_DIRECTORY/tree.expected-output
10 test_begin_subtest "Basic notmuch-tree view in emacs"
11 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
12 (notmuch-tree "tag:inbox")
15 (delete-other-windows)'
16 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox
18 test_begin_subtest "Refreshed notmuch-tree view in emacs"
19 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
20 (notmuch-tree "tag:inbox")
22 (notmuch-tree-refresh-view)
25 (delete-other-windows)'
26 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox
28 # In the following tag tests we make sure the display is updated
29 # correctly and, in a separate test, that the database is updated
32 test_begin_subtest "Tag message in notmuch tree view (display)"
33 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
34 (notmuch-tree "tag:inbox")
37 (notmuch-tree-tag (list "+test_tag"))
39 (delete-other-windows)'
40 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox-tagged
42 test_begin_subtest "Tag message in notmuch tree view (database)"
43 output=$(notmuch search --output=messages 'tag:test_tag')
44 test_expect_equal "$output" "id:877h1wv7mg.fsf@inf-8657.int-evry.fr"
46 test_begin_subtest "Untag message in notmuch tree view"
47 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
48 (notmuch-tree "tag:inbox")
51 (notmuch-tree-tag (list "-test_tag"))
53 (delete-other-windows)'
54 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox
56 test_begin_subtest "Untag message in notmuch tree view (database)"
57 output=$(notmuch search --output=messages 'tag:test_tag')
58 test_expect_equal "$output" ""
60 test_begin_subtest "Tag thread in notmuch tree view"
61 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
62 (notmuch-tree "tag:inbox")
64 ;; move to a sizable thread
66 (notmuch-tree-tag-thread (list "+test_thread_tag"))
68 (delete-other-windows)'
69 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox-thread-tagged
71 test_begin_subtest "Tag message in notmuch tree view (database)"
72 output=$(notmuch search --output=messages 'tag:test_thread_tag')
73 test_expect_equal "$output" \
74 "id:87ocn0qh6d.fsf@yoom.home.cworth.org
75 id:20091118005040.GA25380@dottiness.seas.harvard.edu
76 id:yunaayketfm.fsf@aiko.keithp.com
77 id:87fx8can9z.fsf@vertex.dottedmag
78 id:20091117203301.GV3165@dottiness.seas.harvard.edu
79 id:87iqd9rn3l.fsf@vertex.dottedmag
80 id:20091117190054.GU3165@dottiness.seas.harvard.edu"
82 test_begin_subtest "Untag thread in notmuch tree view"
83 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
84 (notmuch-tree "tag:inbox")
86 ;; move to the same sizable thread as above
88 (notmuch-tree-tag-thread (list "-test_thread_tag"))
90 (delete-other-windows)'
91 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox
93 test_begin_subtest "Untag message in notmuch tree view (database)"
94 output=$(notmuch search --output=messages 'tag:test_thread_tag')
95 test_expect_equal "$output" ""
97 test_begin_subtest "Navigation of notmuch-hello to search results"
98 test_emacs '(notmuch-hello)
99 (goto-char (point-min))
100 (re-search-forward "inbox")
101 (widget-button-press (1- (point)))
103 (notmuch-tree-from-search-current-query)
106 (delete-other-windows)'
107 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox
109 test_begin_subtest "Tree view of a single thread (from search)"
110 test_emacs '(notmuch-hello)
111 (goto-char (point-min))
112 (re-search-forward "inbox")
113 (widget-button-press (1- (point)))
115 (notmuch-tree-from-search-thread)
118 (delete-other-windows)'
119 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-single-thread
121 test_begin_subtest "Tree view of a single thread (from show)"
122 test_emacs '(notmuch-hello)
123 (goto-char (point-min))
124 (re-search-forward "inbox")
125 (widget-button-press (1- (point)))
127 (notmuch-search-show-thread)
128 (notmuch-tree-from-show-current-query)
131 (delete-other-windows)'
132 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-single-thread
134 test_begin_subtest "Message window of tree view"
135 test_emacs '(notmuch-hello)
136 (goto-char (point-min))
137 (re-search-forward "inbox")
138 (widget-button-press (1- (point)))
140 (notmuch-search-next-thread)
141 (notmuch-tree-from-search-thread)
143 (select-window notmuch-tree-message-window)
145 (delete-other-windows)'
146 cp OUTPUT /tmp/mjwout
147 test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-show-window
149 test_begin_subtest "Stash id"
150 output=$(test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
151 (require (quote notmuch-tree))
152 (notmuch-tree "id:1258498485-sup-142@elly")
154 (notmuch-show-stash-message-id)')
155 test_expect_equal "$output" "\"Stashed: id:1258498485-sup-142@elly\""
157 test_begin_subtest "Move to next matching message"
158 output=$(test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
159 (require (quote notmuch-tree))
160 (notmuch-tree "from:cworth")
162 (notmuch-tree-next-matching-message)
163 (notmuch-show-stash-message-id)')
164 test_expect_equal "$output" "\"Stashed: id:878we4qdqf.fsf@yoom.home.cworth.org\""
166 test_begin_subtest "Move to next thread"
167 output=$(test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
168 (require (quote notmuch-tree))
169 (notmuch-tree "tag:inbox")
172 (notmuch-tree-next-thread)
173 (notmuch-show-stash-message-id)')
174 test_expect_equal "$output" "\"Stashed: id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net\""
176 test_begin_subtest "Move to previous thread"
177 output=$(test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
178 (require (quote notmuch-tree))
179 (notmuch-tree "tag:inbox")
182 (notmuch-tree-prev-thread)
183 (notmuch-show-stash-message-id)')
184 test_expect_equal "$output" "\"Stashed: id:20091117190054.GU3165@dottiness.seas.harvard.edu\""
186 test_begin_subtest "Move to previous previous thread"
187 output=$(test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
188 (require (quote notmuch-tree))
189 (notmuch-tree "tag:inbox")
192 (notmuch-tree-prev-thread)
193 (notmuch-tree-prev-thread)
194 (notmuch-show-stash-message-id)')
195 test_expect_equal "$output" "\"Stashed: id:1258493565-13508-1-git-send-email-keithp@keithp.com\""