]> git.notmuchmail.org Git - notmuch/blob - contrib/notmuch-pick/test/emacs-pick-sync
a7da0ff3bed05529c03d186c9b9e3915c7df58bc
[notmuch] / contrib / notmuch-pick / test / emacs-pick-sync
1 #!/usr/bin/env bash
2
3 test_description="emacs pick interface (sync parser)"
4 . test-lib.sh
5
6 EXPECTED=$TEST_DIRECTORY/pick.expected-output
7
8 add_email_corpus
9 test_begin_subtest "Do we have emacs"
10 test_emacs '(insert "hello\n")
11             (test-output)'
12 cat <<EOF >EXPECTED
13 hello
14 EOF
15 test_expect_equal_file OUTPUT EXPECTED
16
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             (setq notmuch-pick-asynchronous-parser nil)
21             (notmuch-pick "tag:inbox")
22             (notmuch-test-wait)
23             (test-output)
24             (delete-other-windows)'
25 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox
26
27 test_begin_subtest "Navigation of notmuch-hello to search results"
28 test_emacs '(notmuch-hello)
29             (goto-char (point-min))
30             (re-search-forward "inbox")
31             (widget-button-press (1- (point)))
32             (notmuch-test-wait)
33             (notmuch-pick-from-search-current-query)
34             (notmuch-test-wait)
35             (test-output)
36             (delete-other-windows)'
37 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox
38
39 test_begin_subtest "Pick of a single thread (from search)"
40 test_emacs '(notmuch-hello)
41             (goto-char (point-min))
42             (re-search-forward "inbox")
43             (widget-button-press (1- (point)))
44             (notmuch-test-wait)
45             (notmuch-pick-from-search-thread)
46             (notmuch-test-wait)
47             (test-output)
48             (delete-other-windows)'
49 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-single-thread
50
51 test_begin_subtest "Pick of a single thread (from show)"
52 test_emacs '(notmuch-hello)
53             (goto-char (point-min))
54             (re-search-forward "inbox")
55             (widget-button-press (1- (point)))
56             (notmuch-test-wait)
57             (notmuch-search-show-thread)
58             (notmuch-pick-from-show-current-query)
59             (notmuch-test-wait)
60             (test-output)
61             (delete-other-windows)'
62 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-single-thread
63
64 test_done