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 6544C431FBD
\r
6 for <notmuch@notmuchmail.org>; Wed, 8 Aug 2012 00:36:33 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.098 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_MED=-2.3] 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 HDAI1lXYXCkB for <notmuch@notmuchmail.org>;
\r
17 Wed, 8 Aug 2012 00:36:32 -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 AFEA5431FAE
\r
22 for <notmuch@notmuchmail.org>; Wed, 8 Aug 2012 00:36:31 -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 1Sz0od-00027N-Eu; Wed, 08 Aug 2012 08:36:29 +0100
\r
27 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]
\r
29 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)
\r
30 (envelope-from <m.walters@qmul.ac.uk>)
\r
31 id 1Sz0od-0000Wb-0r; Wed, 08 Aug 2012 08:36:27 +0100
\r
32 From: Mark Walters <markwalters1009@gmail.com>
\r
33 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
\r
34 Subject: Re: [PATCH v2] test: Add test for messages with missing headers
\r
35 In-Reply-To: <1344389313-7886-1-git-send-email-amdragon@mit.edu>
\r
36 References: <1344374501-28185-1-git-send-email-amdragon@mit.edu>
\r
37 <1344389313-7886-1-git-send-email-amdragon@mit.edu>
\r
38 User-Agent: Notmuch/0.13.2+96~g634443c (http://notmuchmail.org) Emacs/23.4.1
\r
39 (x86_64-pc-linux-gnu)
\r
40 Date: Wed, 08 Aug 2012 08:36:21 +0100
\r
41 Message-ID: <87628t3kei.fsf@qmul.ac.uk>
\r
43 Content-Type: text/plain; charset=us-ascii
\r
44 X-Sender-Host-Address: 94.192.233.223
\r
45 X-QM-SPAM-Info: Sender has good ham record. :)
\r
46 X-QM-Body-MD5: d65b4b6cda6ec7a9b633692dbd1a2548 (of first 20000 bytes)
\r
47 X-SpamAssassin-Score: -1.8
\r
48 X-SpamAssassin-SpamBar: -
\r
49 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
51 spam. We require at least 5.0 points to mark a message as spam.
\r
52 This message scored -1.8 points.
\r
53 Summary of the scoring:
\r
54 * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,
\r
56 * [138.37.6.40 listed in list.dnswl.org]
\r
57 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
58 provider * (markwalters1009[at]gmail.com)
\r
59 * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay
\r
61 * 0.5 AWL AWL: From: address is in the auto white-list
\r
62 X-QM-Scan-Virus: ClamAV says the message is clean
\r
63 X-BeenThere: notmuch@notmuchmail.org
\r
64 X-Mailman-Version: 2.1.13
\r
66 List-Id: "Use and development of the notmuch mail system."
\r
67 <notmuch.notmuchmail.org>
\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
71 List-Post: <mailto:notmuch@notmuchmail.org>
\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
74 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
75 X-List-Received-Date: Wed, 08 Aug 2012 07:36:33 -0000
\r
78 On Wed, 08 Aug 2012, Austin Clements <amdragon@MIT.EDU> wrote:
\r
79 > Currently the JSON tests for search and show are broken because
\r
80 > notmuch attempts to dereference a NULL pointer.
\r
82 > This version fixes the "Show: text" test so that it sanitize its
\r
83 > output and doesn't hard-code my test paths.
\r
85 LGTM +1. Tests work as expected and all tests pass with
\r
86 id:"874noe1o0r.fsf@qmul.ac.uk" applied.
\r
92 > test/missing-headers | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++
\r
93 > test/notmuch-test | 1 +
\r
94 > 2 files changed, 163 insertions(+)
\r
95 > create mode 100755 test/missing-headers
\r
97 > diff --git a/test/missing-headers b/test/missing-headers
\r
98 > new file mode 100755
\r
99 > index 0000000..e79f922
\r
101 > +++ b/test/missing-headers
\r
102 > @@ -0,0 +1,162 @@
\r
103 > +#!/usr/bin/env bash
\r
104 > +test_description='messages with missing headers'
\r
107 > +# Notmuch requires at least one of from, subject, or to or it will
\r
108 > +# ignore the file. Generate two messages so that together they cover
\r
109 > +# all possible missing headers. We also give one of the messages a
\r
110 > +# date to ensure stable result ordering.
\r
112 > +cat <<EOF > "${MAIL_DIR}/msg-2"
\r
113 > +To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
114 > +Date: Fri, 05 Jan 2001 15:43:57 +0000
\r
119 > +cat <<EOF > "${MAIL_DIR}/msg-1"
\r
120 > +From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
127 > +test_begin_subtest "Search: text"
\r
128 > +output=$(notmuch search '*' | notmuch_search_sanitize)
\r
129 > +test_expect_equal "$output" "\
\r
130 > +thread:XXX 2001-01-05 [1/1] (null); (inbox unread)
\r
131 > +thread:XXX 1970-01-01 [1/1] Notmuch Test Suite; (inbox unread)"
\r
133 > +test_begin_subtest "Search: json"
\r
134 > +test_subtest_known_broken
\r
135 > +output=$(notmuch search --format=json '*' | notmuch_search_sanitize)
\r
136 > +test_expect_equal_json "$output" '
\r
140 > + "date_relative": "2001-01-05",
\r
147 > + "thread": "XXX",
\r
148 > + "timestamp": 978709437,
\r
152 > + "authors": "Notmuch Test Suite",
\r
153 > + "date_relative": "1970-01-01",
\r
160 > + "thread": "XXX",
\r
161 > + "timestamp": 0,
\r
166 > +test_begin_subtest "Show: text"
\r
167 > +output=$(notmuch show '*' | notmuch_show_sanitize)
\r
168 > +test_expect_equal "$output" "\
\r
170 message{ id:notmuch-sha1-7a6e4eac383ef958fcd3ebf2143db71b8ff01161 depth:0 match:1 excluded:0 filename:/XXX/mail/msg-2
\r
173 > + (2001-01-05) (inbox unread)
\r
176 > +To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
177 > +Date: Fri, 05 Jan 2001 15:43:57 +0000
\r
183 part{ ID: 1, Content-type: text/plain
\r
192 message{ id:notmuch-sha1-ca55943aff7a72baf2ab21fa74fab3d632401334 depth:0 match:1 excluded:0 filename:/XXX/mail/msg-1
\r
195 > +Notmuch Test Suite <test_suite@notmuchmail.org> (1970-01-01) (inbox unread)
\r
197 > +From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
198 > +Date: Thu, 01 Jan 1970 00:00:00 +0000
\r
204 part{ ID: 1, Content-type: text/plain
\r
213 > +test_begin_subtest "Show: json"
\r
214 > +test_subtest_known_broken
\r
215 > +output=$(notmuch show --format=json '*' | notmuch_json_show_sanitize)
\r
216 > +test_expect_equal_json "$output" '
\r
223 > + "content": "Body\n",
\r
224 > + "content-type": "text/plain",
\r
228 > + "date_relative": "2001-01-05",
\r
229 > + "excluded": false,
\r
230 > + "filename": "YYYYY",
\r
232 > + "Date": "Fri, 05 Jan 2001 15:43:57 +0000",
\r
235 > + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>"
\r
243 > + "timestamp": 978709437
\r
253 > + "content": "Body\n",
\r
254 > + "content-type": "text/plain",
\r
258 > + "date_relative": "1970-01-01",
\r
259 > + "excluded": false,
\r
260 > + "filename": "YYYYY",
\r
262 > + "Date": "Thu, 01 Jan 1970 00:00:00 +0000",
\r
263 > + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",
\r
281 > diff --git a/test/notmuch-test b/test/notmuch-test
\r
282 > index ea39dfc..cc732c3 100755
\r
283 > --- a/test/notmuch-test
\r
284 > +++ b/test/notmuch-test
\r
285 > @@ -59,6 +59,7 @@ TESTS="
\r
286 > emacs-address-cleaning
\r
289 > + missing-headers
\r
291 > TESTS=${NOTMUCH_TESTS:=$TESTS}
\r
296 > _______________________________________________
\r
297 > notmuch mailing list
\r
298 > notmuch@notmuchmail.org
\r
299 > http://notmuchmail.org/mailman/listinfo/notmuch
\r