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 (let ((current-prefix-arg t))
95 (notmuch-search-show-thread))
97 (test-visible-output))'
98 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-elide-non-matching-messages-on
100 test_begin_subtest "notmuch-show: disable indentation of thread content (w/ notmuch-show-toggle-thread-indentation)"
101 test_emacs '(notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"")
103 (notmuch-search-show-thread)
105 (notmuch-show-toggle-thread-indentation)
106 (test-visible-output)'
107 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-indent-thread-content-off
109 test_begin_subtest "id buttonization"
110 add_message '[body]="
112 id:abc.def. id:abc,def, id:abc;def; id:abc:def:
113 id:foo@bar.?baz? id:foo@bar!.baz!
114 (id:foo@bar.baz) [id:foo@bar.baz]
131 mid:abc. mid:abc, mid:abc;"'
132 test_emacs '(notmuch-show "id:'$gen_msg_id'")
133 (notmuch-test-mark-links)
134 (test-visible-output)'
136 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)
137 Subject: id buttonization
138 To: Notmuch Test Suite <test_suite@notmuchmail.org>
139 Date: Fri, 05 Jan 2001 15:43:57 +0000
142 <<id:abc.def>>. <<id:abc,def>>, <<id:abc;def>>; <<id:abc:def>>:
143 <<id:foo@bar.?baz>>? <<id:foo@bar!.baz>>!
144 (<<id:foo@bar.baz>>) [<<id:foo@bar.baz>>]
145 <<id:foo@bar.baz>>...
159 <<mid:abc>> <<mid:abc/def>>
161 <<mid:abc>>. <<mid:abc>>, <<mid:abc>>;
163 test_expect_equal_file OUTPUT EXPECTED
166 test_begin_subtest "Show handles subprocess errors"
167 cat > notmuch_fail <<EOF
170 echo This is an error >&2
173 chmod a+x notmuch_fail
174 test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\"))
175 (with-current-buffer \"*Messages*\" (erase-buffer))
178 (error (message \"%s\" (second err))))
180 (with-current-buffer \"*Messages*\"
181 (test-output \"MESSAGES\"))
182 (with-current-buffer \"*Notmuch errors*\"
183 (test-output \"ERROR\"))
185 sed -i -e 's/^\[.*\]$/[XXX]/' ERROR
186 test_expect_equal "$(cat OUTPUT; echo ---; cat MESSAGES; echo ---; cat ERROR)" "\
188 This is an error (see *Notmuch errors* for more details)
192 command: $PWD/notmuch_fail show --format\\=json --format-version\\=1 --exclude\\=false \\' \\* \\'