1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
| | #!/usr/bin/env bash
test_description="emacs notmuch-show view"
. test-lib.sh
test_begin_subtest "Hiding Original Message region at beginning of a message"
message_id='OriginalMessageHiding.1@notmuchmail.org'
add_message \
[id]="$message_id" \
'[subject]="Hiding Original Message region at beginning of a message"' \
'[body]="-----Original Message-----
Text here."'
cat <<EOF >EXPECTED
Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)
Subject: Hiding Original Message region at beginning of a message
To: Notmuch Test Suite <test_suite@notmuchmail.org>
Date: Fri, 05 Jan 2001 15:43:57 +0000
[ 2-line hidden original message. Click/Enter to show. ]
EOF
test_emacs "(notmuch-show \"id:$message_id\")
(test-visible-output)"
test_expect_equal_file OUTPUT EXPECTED
test_begin_subtest "Bare subject #1"
output=$(test_emacs '(notmuch-show-strip-re "Re: subject")')
test_expect_equal "$output" '"subject"'
test_begin_subtest "Bare subject #2"
output=$(test_emacs '(notmuch-show-strip-re "re:Re: re: Re: re:subject")')
test_expect_equal "$output" '"subject"'
test_begin_subtest "Bare subject #3"
output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")')
test_expect_equal "$output" '"the cure: fix the regexp"'
test_begin_subtest "Toggle display multipart/alternative"
cat <<EOF > ${MAIL_DIR}/embedded_message
From: Carl Worth <cworth@cworth.org>
To: cworth@cworth.org
Subject: html message
Date: Fri, 05 Jan 2001 15:42:57 +0000
User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)
Message-ID: <87liy5ap01.fsf@yoom.home.cworth.org>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="==-=-=="
--==-=-==
Content-Type: text/html
<p>This is the text/html part of a multipart/alternative.</p>
--==-=-==
Content-Type: text/plain
This is the text/plain part of a multipart/alternative.
--==-=-==--
EOF
notmuch new > /dev/null
test_emacs "(let ((notmuch-show-all-multipart/alternative-parts nil))
(notmuch-show \"id:87liy5ap01.fsf@yoom.home.cworth.org\")
(test-output))"
mv OUTPUT{,.text}
test_emacs "(let ((notmuch-show-all-multipart/alternative-parts nil))
(notmuch-show \"id:87liy5ap01.fsf@yoom.home.cworth.org\")
(notmuch-show-cycle-message-multipart)
(test-output))"
mv OUTPUT{,.html}
diff OUTPUT.{text,html} >OUTPUT.diff
cat <<EOF >EXPECTED.diff
7,9c7,10
< [ text/html (not shown) ]
< [ text/plain ]
< This is the text/plain part of a multipart/alternative.
---
> [ text/html ]
> This is the text/html part of a multipart/alternative.
>
> [ text/plain (not shown) ]
EOF
test_expect_equal_file {OUTPUT,EXPECTED}.diff
test_done
|