]> git.cworth.org Git - obsolete/notmuch-old/blob - test/emacs-show
64c38d30593dfa5667f3917ca4b490e051e9212f
[obsolete/notmuch-old] / test / emacs-show
1 #!/usr/bin/env bash
2
3 test_description="emacs notmuch-show view"
4 . test-lib.sh
5
6 EXPECTED=$TEST_DIRECTORY/emacs-show.expected-output
7
8 add_email_corpus
9
10 test_begin_subtest "Hiding Original Message region at beginning of a message"
11 message_id='OriginalMessageHiding.1@notmuchmail.org'
12 add_message \
13     [id]="$message_id" \
14     '[subject]="Hiding Original Message region at beginning of a message"' \
15     '[body]="-----Original Message-----
16 Text here."'
17
18 cat <<EOF >EXPECTED
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
23
24 [ 2-line hidden original message. Click/Enter to show. ]
25 EOF
26
27 test_emacs "(notmuch-show \"id:$message_id\")
28             (test-visible-output)"
29 test_expect_equal_file OUTPUT EXPECTED
30
31 test_begin_subtest "Bare subject #1"
32 output=$(test_emacs '(notmuch-show-strip-re "Re: subject")')
33 test_expect_equal "$output" '"subject"'
34
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"'
38
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"'
42
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
48
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
54
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
61
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\"")
65         (notmuch-test-wait)
66         (notmuch-search-show-thread)
67         (notmuch-test-wait)
68         (test-visible-output))'
69 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-elide-non-matching-messages-off
70
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\"")
74         (notmuch-test-wait)
75         (notmuch-search-show-thread)
76         (notmuch-test-wait)
77         (test-visible-output))'
78 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-elide-non-matching-messages-on
79
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\"")
83         (notmuch-test-wait)
84         (notmuch-search-show-thread)
85         (notmuch-test-wait)
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
89
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\"")
93         (notmuch-test-wait)
94         (let ((current-prefix-arg t))
95           (notmuch-search-show-thread))
96         (notmuch-test-wait)
97         (test-visible-output))'
98 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-elide-non-matching-messages-on
99
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\"")
102         (notmuch-test-wait)
103         (notmuch-search-show-thread)
104         (notmuch-test-wait)
105         (notmuch-show-toggle-thread-indentation)
106         (test-visible-output)'
107 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-indent-thread-content-off
108
109
110 test_done