3 test_description="emacs notmuch-show view"
6 EXPECTED=$TEST_DIRECTORY/emacs-show.expected-output
10 test_begin_subtest "Hiding Original Message region at beginning of a message"
11 message_id='OriginalMessageHiding.1@notmuchmail.org'
14 '[subject]="Hiding Original Message region at beginning of a message"' \
15 '[body]="-----Original Message-----
19 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)
20 Subject: Hiding Original Message region at beginning of a message
21 To: Notmuch Test Suite <test_suite@notmuchmail.org>
22 Date: Fri, 05 Jan 2001 15:43:57 +0000
24 [ 2-line hidden original message. Click/Enter to show. ]
27 test_emacs "(notmuch-show \"id:$message_id\")
28 (test-visible-output)"
29 test_expect_equal_file OUTPUT EXPECTED
31 test_begin_subtest "Bare subject #1"
32 output=$(test_emacs '(notmuch-show-strip-re "Re: subject")')
33 test_expect_equal "$output" '"subject"'
35 test_begin_subtest "Bare subject #2"
36 output=$(test_emacs '(notmuch-show-strip-re "re:Re: re: Re: re:subject")')
37 test_expect_equal "$output" '"subject"'
39 test_begin_subtest "Bare subject #3"
40 output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")')
41 test_expect_equal "$output" '"the cure: fix the regexp"'
43 test_begin_subtest "don't process cryptographic MIME parts"
44 test_emacs '(let ((notmuch-crypto-process-mime nil))
45 (notmuch-show "id:20091117203301.GV3165@dottiness.seas.harvard.edu")
46 (test-visible-output))'
47 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-process-crypto-mime-parts-off
49 test_begin_subtest "process cryptographic MIME parts"
50 test_emacs '(let ((notmuch-crypto-process-mime t))
51 (notmuch-show "id:20091117203301.GV3165@dottiness.seas.harvard.edu")
52 (test-visible-output))'
53 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-process-crypto-mime-parts-on
55 test_begin_subtest "process cryptographic MIME parts (w/ notmuch-show-toggle-process-crypto)"
56 test_emacs '(let ((notmuch-crypto-process-mime nil))
57 (notmuch-show "id:20091117203301.GV3165@dottiness.seas.harvard.edu")
58 (notmuch-show-toggle-process-crypto)
59 (test-visible-output))'
60 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-process-crypto-mime-parts-on
62 test_begin_subtest "notmuch-show: don't elide non-matching messages"
63 test_emacs '(let ((notmuch-show-only-matching-messages nil))
64 (notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"")
66 (notmuch-search-show-thread)
68 (test-visible-output))'
69 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-elide-non-matching-messages-off
71 test_begin_subtest "notmuch-show: elide non-matching messages"
72 test_emacs '(let ((notmuch-show-only-matching-messages t))
73 (notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"")
75 (notmuch-search-show-thread)
77 (test-visible-output))'
78 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-elide-non-matching-messages-on
80 test_begin_subtest "notmuch-show: elide non-matching messages (w/ notmuch-show-toggle-elide-non-matching)"
81 test_emacs '(let ((notmuch-show-only-matching-messages nil))
82 (notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"")
84 (notmuch-search-show-thread)
86 (notmuch-show-toggle-elide-non-matching)
87 (test-visible-output))'
88 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-elide-non-matching-messages-on
90 test_begin_subtest "notmuch-show: elide non-matching messages (w/ prefix arg to notmuch-show)"
91 test_emacs '(let ((notmuch-show-only-matching-messages nil))
92 (notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"")
94 (notmuch-search-show-thread t)
96 (test-visible-output))'
97 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-elide-non-matching-messages-on
99 test_begin_subtest "notmuch-show: disable indentation of thread content (w/ notmuch-show-toggle-thread-indentation)"
100 test_emacs '(notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"")
102 (notmuch-search-show-thread)
104 (notmuch-show-toggle-thread-indentation)
105 (test-visible-output)'
106 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-indent-thread-content-off
108 test_begin_subtest "id buttonization"
109 add_message '[body]="
111 id:abc.def. id:abc,def, id:abc;def; id:abc:def:
112 id:foo@bar.?baz? id:foo@bar!.baz!
113 (id:foo@bar.baz) [id:foo@bar.baz]
130 mid:abc. mid:abc, mid:abc;"'
131 test_emacs '(notmuch-show "id:'$gen_msg_id'")
132 (notmuch-test-mark-links)
133 (test-visible-output)'
135 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)
136 Subject: id buttonization
137 To: Notmuch Test Suite <test_suite@notmuchmail.org>
138 Date: Fri, 05 Jan 2001 15:43:57 +0000
141 <<id:abc.def>>. <<id:abc,def>>, <<id:abc;def>>; <<id:abc:def>>:
142 <<id:foo@bar.?baz>>? <<id:foo@bar!.baz>>!
143 (<<id:foo@bar.baz>>) [<<id:foo@bar.baz>>]
144 <<id:foo@bar.baz>>...
158 <<mid:abc>> <<mid:abc/def>>
160 <<mid:abc>>. <<mid:abc>>, <<mid:abc>>;
162 test_expect_equal_file OUTPUT EXPECTED
165 test_begin_subtest "Show handles subprocess errors"
166 cat > notmuch_fail <<EOF
169 echo This is an error >&2
172 chmod a+x notmuch_fail
173 test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\"))
174 (with-current-buffer \"*Messages*\" (erase-buffer))
177 (error (message \"%s\" (second err))))
179 (with-current-buffer \"*Messages*\"
180 (test-output \"MESSAGES\"))
181 (with-current-buffer \"*Notmuch errors*\"
182 (test-output \"ERROR\"))
184 test_expect_equal "$(notmuch_emacs_error_sanitize notmuch_fail OUTPUT MESSAGES ERROR)" "\
187 This is an error (see *Notmuch errors* for more details)
191 command: YYY/notmuch_fail show --format\\=sexp --format-version\\=1 --exclude\\=false \\' \\* \\'