1 Return-Path: <m.walters@qmul.ac.uk>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id BE204431FAF
\r
6 for <notmuch@notmuchmail.org>; Thu, 24 Apr 2014 23:18:48 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.502 tagged_above=-999 required=5
\r
12 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,
\r
13 NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id 15P6tpxUZkYj for <notmuch@notmuchmail.org>;
\r
17 Thu, 24 Apr 2014 23:18:44 -0700 (PDT)
\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id D7C75431FAE
\r
22 for <notmuch@notmuchmail.org>; Thu, 24 Apr 2014 23:18:43 -0700 (PDT)
\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])
\r
24 by mail2.qmul.ac.uk with esmtp (Exim 4.71)
\r
25 (envelope-from <m.walters@qmul.ac.uk>)
\r
26 id 1WdZT3-0004EA-3t; Fri, 25 Apr 2014 07:18:37 +0100
\r
27 Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost)
\r
28 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)
\r
29 (envelope-from <m.walters@qmul.ac.uk>)
\r
30 id 1WdZT2-00035Q-Lu; Fri, 25 Apr 2014 07:18:36 +0100
\r
31 From: Mark Walters <markwalters1009@gmail.com>
\r
32 To: Austin Clements <amdragon@MIT.EDU>
\r
33 Subject: Re: [PATCH 02/11] test: New tests for Emacs charset handling
\r
34 In-Reply-To: <20140424182931.GP25817@mit.edu>
\r
35 References: <1398105468-14317-1-git-send-email-amdragon@mit.edu>
\r
36 <1398105468-14317-3-git-send-email-amdragon@mit.edu>
\r
37 <87mwfau70e.fsf@qmul.ac.uk> <20140424182931.GP25817@mit.edu>
\r
38 User-Agent: Notmuch/0.15.2+615~g78e3a93 (http://notmuchmail.org) Emacs/23.4.1
\r
39 (x86_64-pc-linux-gnu)
\r
40 Date: Fri, 25 Apr 2014 07:18:35 +0100
\r
41 Message-ID: <87fvl2szib.fsf@qmul.ac.uk>
\r
43 Content-Type: text/plain; charset=us-ascii
\r
44 X-Sender-Host-Address: 87.81.223.162
\r
45 X-QM-Geographic: According to ripencc,
\r
46 this message was delivered by a machine in Britain (UK) (GB).
\r
47 X-QM-SPAM-Info: Sender has good ham record. :)
\r
48 X-QM-Body-MD5: 26b5b44b3f4a251b95c1a8ec010ed878 (of first 20000 bytes)
\r
49 X-SpamAssassin-Score: -0.1
\r
50 X-SpamAssassin-SpamBar: /
\r
51 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
53 spam. We require at least 5.0 points to mark a message as spam.
\r
54 This message scored -0.1 points.
\r
55 Summary of the scoring:
\r
56 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
57 provider * (markwalters1009[at]gmail.com)
\r
58 * -0.1 AWL AWL: From: address is in the auto white-list
\r
59 X-QM-Scan-Virus: ClamAV says the message is clean
\r
60 Cc: notmuch@notmuchmail.org
\r
61 X-BeenThere: notmuch@notmuchmail.org
\r
62 X-Mailman-Version: 2.1.13
\r
64 List-Id: "Use and development of the notmuch mail system."
\r
65 <notmuch.notmuchmail.org>
\r
66 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
69 List-Post: <mailto:notmuch@notmuchmail.org>
\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
71 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
72 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
73 X-List-Received-Date: Fri, 25 Apr 2014 06:18:48 -0000
\r
75 On Thu, 24 Apr 2014, Austin Clements <amdragon@MIT.EDU> wrote:
\r
76 > Quoth Mark Walters on Apr 24 at 3:38 pm:
\r
78 >> On Mon, 21 Apr 2014, Austin Clements <amdragon@MIT.EDU> wrote:
\r
79 >> > The test of viewing 8bit messages is known-broken. The rest pass, but
\r
80 >> > for very fragile reasons. The next several commits will fix the
\r
81 >> > known-broken test and make our charset handling robust.
\r
85 >> On one of my systems one of these (non-broken) tests fails. I am not
\r
86 >> sure whether I messed up my emacs/environment when doing stuff remotely
\r
87 >> recently so it could just be my system
\r
91 >> > test/T455-emacs-charsets.sh | 141 ++++++++++++++++++++++++++++++++++++++++++++
\r
92 >> > test/test-lib.el | 4 +-
\r
93 >> > 2 files changed, 144 insertions(+), 1 deletion(-)
\r
94 >> > create mode 100755 test/T455-emacs-charsets.sh
\r
96 >> > diff --git a/test/T455-emacs-charsets.sh b/test/T455-emacs-charsets.sh
\r
97 >> > new file mode 100755
\r
98 >> > index 0000000..a42a1d2
\r
100 >> > +++ b/test/T455-emacs-charsets.sh
\r
101 >> > @@ -0,0 +1,141 @@
\r
102 >> > +#!/usr/bin/env bash
\r
104 >> > +test_description="emacs notmuch-show charset handling"
\r
105 >> > +. ./test-lib.sh
\r
108 >> > +UTF8_YEN=$'\xef\xbf\xa5'
\r
109 >> > +BIG5_YEN=$'\xa2\x44'
\r
111 >> > +# Add four messages with unusual encoding requirements:
\r
113 >> > +# 1) text/plain in quoted-printable big5
\r
114 >> > +generate_message \
\r
115 >> > + [id]=test-plain@example.com \
\r
116 >> > + '[content-type]="text/plain; charset=big5"' \
\r
117 >> > + '[content-transfer-encoding]=quoted-printable' \
\r
118 >> > + '[body]="Yen: =A2=44"'
\r
120 >> > +# 2) text/plain in 8bit big5
\r
121 >> > +generate_message \
\r
122 >> > + [id]=test-plain-8bit@example.com \
\r
123 >> > + '[content-type]="text/plain; charset=big5"' \
\r
124 >> > + '[content-transfer-encoding]=8bit' \
\r
125 >> > + '[body]="Yen: '$BIG5_YEN'"'
\r
127 >> > +# 3) text/html in quoted-printable big5
\r
128 >> > +generate_message \
\r
129 >> > + [id]=test-html@example.com \
\r
130 >> > + '[content-type]="text/html; charset=big5"' \
\r
131 >> > + '[content-transfer-encoding]=quoted-printable' \
\r
132 >> > + '[body]="<html><body>Yen: =A2=44</body></html>"'
\r
134 >> > +# 4) application/octet-stream in quoted-printable of big5 text
\r
135 >> > +generate_message \
\r
136 >> > + [id]=test-binary@example.com \
\r
137 >> > + '[content-type]="application/octet-stream"' \
\r
138 >> > + '[content-transfer-encoding]=quoted-printable' \
\r
139 >> > + '[body]="Yen: =A2=44"'
\r
141 >> > +notmuch new > /dev/null
\r
143 >> > +# Test rendering
\r
145 >> > +test_begin_subtest "Text parts are decoded when rendering"
\r
146 >> > +test_emacs '(notmuch-show "id:test-plain@example.com")
\r
147 >> > + (test-visible-output "OUTPUT.raw")'
\r
148 >> > +awk 'show {print} /^$/ {show=1}' < OUTPUT.raw > OUTPUT
\r
149 >> > +cat <<EOF >EXPECTED
\r
150 >> > +Yen: $UTF8_YEN
\r
152 >> > +test_expect_equal_file OUTPUT EXPECTED
\r
154 >> > +test_begin_subtest "8bit text parts are decoded when rendering"
\r
155 >> > +test_emacs '(notmuch-show "id:test-plain-8bit@example.com")
\r
156 >> > + (test-visible-output "OUTPUT.raw")'
\r
157 >> > +awk 'show {print} /^$/ {show=1}' < OUTPUT.raw > OUTPUT
\r
158 >> > +cat <<EOF >EXPECTED
\r
159 >> > +Yen: $UTF8_YEN
\r
161 >> > +test_expect_equal_file OUTPUT EXPECTED
\r
163 >> > +test_begin_subtest "HTML parts are decoded when rendering"
\r
164 >> > +test_emacs '(notmuch-show "id:test-html@example.com")
\r
165 >> > + (test-visible-output "OUTPUT.raw")'
\r
166 >> > +awk 'show {print} /^$/ {show=1}' < OUTPUT.raw > OUTPUT
\r
167 >> > +cat <<EOF >EXPECTED
\r
168 >> > +[ text/html ]
\r
169 >> > +Yen: $UTF8_YEN
\r
171 >> > +test_expect_equal_file OUTPUT EXPECTED
\r
173 >> It's this test: I get an extra newline after the UFT8_YEN.
\r
175 >> This is with emacs 23.4.1 on a Debian wheezy(ish) system.
\r
177 >> But as said it could be my fault: I think some odd things happened when
\r
178 >> I tried to install emacs 24 and 23 simultaneously to help testing
\r
181 > I can reproduce this. Tests that involve HTML rendering are always
\r
182 > finicky like this since there are so many different HTML renderers.
\r
183 > Maybe I could normalize the spacing? sed '/^$/d;s/ */ /g' or so?
\r
185 That sounds plausible. What output would you get if the test genuinely
\r
186 fails? I guess the key thing is to try and make sure the test doesn't
\r