3 test_description="emacs pick interface"
6 EXPECTED=$TEST_DIRECTORY/pick.expected-output
9 test_begin_subtest "Do we have emacs"
10 test_emacs '(insert "hello\n")
15 test_expect_equal_file OUTPUT EXPECTED
17 test_begin_subtest "Basic notmuch-pick view in emacs"
18 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
19 (require (quote notmuch-pick))
20 (notmuch-pick "tag:inbox")
23 (delete-other-windows)'
24 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox
26 test_begin_subtest "Refreshed notmuch-pick view in emacs"
27 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
28 (require (quote notmuch-pick))
29 (notmuch-pick "tag:inbox")
31 (notmuch-pick-refresh-view)
34 (delete-other-windows)'
35 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox
37 # In the following tag tests we make sure the display is updated
38 # correctly and, in a separate test, that the database is updated
41 test_begin_subtest "Tag message in notmuch pick view (display)"
42 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
43 (require (quote notmuch-pick))
44 (notmuch-pick "tag:inbox")
47 (notmuch-pick-tag "+test_tag")
49 (delete-other-windows)'
50 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox-tagged
52 test_begin_subtest "Tag message in notmuch pick view (database)"
53 output=$(notmuch search --output=messages 'tag:test_tag')
54 test_expect_equal "$output" "id:877h1wv7mg.fsf@inf-8657.int-evry.fr"
56 test_begin_subtest "Untag message in notmuch pick view"
57 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
58 (require (quote notmuch-pick))
59 (notmuch-pick "tag:inbox")
62 (notmuch-pick-tag "-test_tag")
64 (delete-other-windows)'
65 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox
67 test_begin_subtest "Untag message in notmuch pick view (database)"
68 output=$(notmuch search --output=messages 'tag:test_tag')
69 test_expect_equal "$output" ""
71 test_begin_subtest "Navigation of notmuch-hello to search results"
72 test_emacs '(notmuch-hello)
73 (goto-char (point-min))
74 (re-search-forward "inbox")
75 (widget-button-press (1- (point)))
77 (notmuch-pick-from-search-current-query)
80 (delete-other-windows)'
81 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox
83 test_begin_subtest "Pick of a single thread (from search)"
84 test_emacs '(notmuch-hello)
85 (goto-char (point-min))
86 (re-search-forward "inbox")
87 (widget-button-press (1- (point)))
89 (notmuch-pick-from-search-thread)
92 (delete-other-windows)'
93 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-single-thread
95 test_begin_subtest "Pick of a single thread (from show)"
96 test_emacs '(notmuch-hello)
97 (goto-char (point-min))
98 (re-search-forward "inbox")
99 (widget-button-press (1- (point)))
101 (notmuch-search-show-thread)
102 (notmuch-pick-from-show-current-query)
105 (delete-other-windows)'
106 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-single-thread
108 test_begin_subtest "Message window of pick"
109 test_emacs '(notmuch-hello)
110 (goto-char (point-min))
111 (re-search-forward "inbox")
112 (widget-button-press (1- (point)))
114 (notmuch-search-next-thread)
115 (notmuch-pick-from-search-thread)
117 (select-window notmuch-pick-message-window)
119 (delete-other-windows)'
120 cp OUTPUT /tmp/mjwout
121 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-show-window