1 Return-Path: <amdragon@mit.edu>
\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 C1F4E431FAF
\r
6 for <notmuch@notmuchmail.org>; Tue, 7 Aug 2012 18:28:41 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id thGjkK+KLwEq for <notmuch@notmuchmail.org>;
\r
16 Tue, 7 Aug 2012 18:28:41 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id D40CB431FAE
\r
20 for <notmuch@notmuchmail.org>; Tue, 7 Aug 2012 18:28:40 -0700 (PDT)
\r
21 X-AuditID: 1209190d-b7fd56d000000933-76-5021c0c57359
\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])
\r
23 by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 78.03.02355.5C0C1205; Tue, 7 Aug 2012 21:28:37 -0400 (EDT)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q781SaPr007205;
\r
27 Tue, 7 Aug 2012 21:28:36 -0400
\r
28 Received: from drake.dyndns.org
\r
29 (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com
\r
30 [209.6.116.242]) (authenticated bits=0)
\r
31 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
32 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q781SYU6021306
\r
33 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
34 Tue, 7 Aug 2012 21:28:36 -0400 (EDT)
\r
35 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)
\r
36 (envelope-from <amdragon@mit.edu>)
\r
37 id 1Syv4c-000276-LB; Tue, 07 Aug 2012 21:28:34 -0400
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH v2] test: Add test for messages with missing headers
\r
41 Date: Tue, 7 Aug 2012 21:28:33 -0400
\r
42 Message-Id: <1344389313-7886-1-git-send-email-amdragon@mit.edu>
\r
43 X-Mailer: git-send-email 1.7.10
\r
44 In-Reply-To: <1344374501-28185-1-git-send-email-amdragon@mit.edu>
\r
45 References: <1344374501-28185-1-git-send-email-amdragon@mit.edu>
\r
46 X-Brightmail-Tracker:
\r
47 H4sIAAAAAAAAA+NgFtrAIsWRmVeSWpSXmKPExsUixG6nonv0gGKAQdcBBYvrN2cyOzB6PFt1
\r
48 izmAMYrLJiU1J7MstUjfLoErY90rmYK/WhVbHl9kbGCcJdPFyMkhIWAicXj5VzYIW0ziwr31
\r
49 QDYXh5DAPkaJo12T2CGc9YwSi17uZoVwHjJJ3HrRzgzSIiQwl1Hi+vdcEJtNQENi2/7ljCC2
\r
50 iIC0xM67s4EaODiYBdQk/nSpgISFBVwkWq7fBdvGIqAqMfv7KbAxvAL2Ev8efWWHuEJe4un9
\r
51 PjaQVk4BR4nf/yMgNjlITFzzi20CI/8CRoZVjLIpuVW6uYmZOcWpybrFyYl5ealFukZ6uZkl
\r
52 eqkppZsYQQHDKcm7g/HdQaVDjAIcjEo8vFHJigFCrIllxZW5hxglOZiURHnv7QUK8SXlp1Rm
\r
53 JBZnxBeV5qQWH2KU4GBWEuFtawXK8aYkVlalFuXDpKQ5WJTEea+k3PQXEkhPLEnNTk0tSC2C
\r
54 ycpwcChJ8OoCI0NIsCg1PbUiLTOnBCHNxMEJMpwHaLg7SA1vcUFibnFmOkT+FKOilDivE0hC
\r
55 ACSRUZoH1wuL6FeM4kCvCPPygFTxAJMBXPcroMFMQIO95eVABpckIqSkGhglU5kD1P0urT5S
\r
56 Z/smUet+ww39V+9V7jJW62Y/V55tte1MgYpjjap/YM/m2LyYH7e3uhfMefCLb/7HlxLHjxpE
\r
57 qlhU7FGUml9kVLxue+0l4/nFmYUJN18cDHIIbJNPLL+9pLk/YsOMpyqzV+zScZh1/NjszZni
\r
58 arnP5NbWzdpzQ2XydMvcVcJKLMUZiYZazEXFiQD3pEo1wwIAAA==
\r
59 X-BeenThere: notmuch@notmuchmail.org
\r
60 X-Mailman-Version: 2.1.13
\r
62 List-Id: "Use and development of the notmuch mail system."
\r
63 <notmuch.notmuchmail.org>
\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
65 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
67 List-Post: <mailto:notmuch@notmuchmail.org>
\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
71 X-List-Received-Date: Wed, 08 Aug 2012 01:28:41 -0000
\r
73 Currently the JSON tests for search and show are broken because
\r
74 notmuch attempts to dereference a NULL pointer.
\r
76 This version fixes the "Show: text" test so that it sanitize its
\r
77 output and doesn't hard-code my test paths.
\r
79 test/missing-headers | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++
\r
80 test/notmuch-test | 1 +
\r
81 2 files changed, 163 insertions(+)
\r
82 create mode 100755 test/missing-headers
\r
84 diff --git a/test/missing-headers b/test/missing-headers
\r
85 new file mode 100755
\r
86 index 0000000..e79f922
\r
88 +++ b/test/missing-headers
\r
90 +#!/usr/bin/env bash
\r
91 +test_description='messages with missing headers'
\r
94 +# Notmuch requires at least one of from, subject, or to or it will
\r
95 +# ignore the file. Generate two messages so that together they cover
\r
96 +# all possible missing headers. We also give one of the messages a
\r
97 +# date to ensure stable result ordering.
\r
99 +cat <<EOF > "${MAIL_DIR}/msg-2"
\r
100 +To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
101 +Date: Fri, 05 Jan 2001 15:43:57 +0000
\r
106 +cat <<EOF > "${MAIL_DIR}/msg-1"
\r
107 +From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
114 +test_begin_subtest "Search: text"
\r
115 +output=$(notmuch search '*' | notmuch_search_sanitize)
\r
116 +test_expect_equal "$output" "\
\r
117 +thread:XXX 2001-01-05 [1/1] (null); (inbox unread)
\r
118 +thread:XXX 1970-01-01 [1/1] Notmuch Test Suite; (inbox unread)"
\r
120 +test_begin_subtest "Search: json"
\r
121 +test_subtest_known_broken
\r
122 +output=$(notmuch search --format=json '*' | notmuch_search_sanitize)
\r
123 +test_expect_equal_json "$output" '
\r
127 + "date_relative": "2001-01-05",
\r
135 + "timestamp": 978709437,
\r
139 + "authors": "Notmuch Test Suite",
\r
140 + "date_relative": "1970-01-01",
\r
153 +test_begin_subtest "Show: text"
\r
154 +output=$(notmuch show '*' | notmuch_show_sanitize)
\r
155 +test_expect_equal "$output" "\
\r
157 message{ id:notmuch-sha1-7a6e4eac383ef958fcd3ebf2143db71b8ff01161 depth:0 match:1 excluded:0 filename:/XXX/mail/msg-2
\r
160 + (2001-01-05) (inbox unread)
\r
163 +To: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
164 +Date: Fri, 05 Jan 2001 15:43:57 +0000
\r
170 part{ ID: 1, Content-type: text/plain
\r
179 message{ id:notmuch-sha1-ca55943aff7a72baf2ab21fa74fab3d632401334 depth:0 match:1 excluded:0 filename:/XXX/mail/msg-1
\r
182 +Notmuch Test Suite <test_suite@notmuchmail.org> (1970-01-01) (inbox unread)
\r
184 +From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
185 +Date: Thu, 01 Jan 1970 00:00:00 +0000
\r
191 part{ ID: 1, Content-type: text/plain
\r
200 +test_begin_subtest "Show: json"
\r
201 +test_subtest_known_broken
\r
202 +output=$(notmuch show --format=json '*' | notmuch_json_show_sanitize)
\r
203 +test_expect_equal_json "$output" '
\r
210 + "content": "Body\n",
\r
211 + "content-type": "text/plain",
\r
215 + "date_relative": "2001-01-05",
\r
216 + "excluded": false,
\r
217 + "filename": "YYYYY",
\r
219 + "Date": "Fri, 05 Jan 2001 15:43:57 +0000",
\r
222 + "To": "Notmuch Test Suite <test_suite@notmuchmail.org>"
\r
230 + "timestamp": 978709437
\r
240 + "content": "Body\n",
\r
241 + "content-type": "text/plain",
\r
245 + "date_relative": "1970-01-01",
\r
246 + "excluded": false,
\r
247 + "filename": "YYYYY",
\r
249 + "Date": "Thu, 01 Jan 1970 00:00:00 +0000",
\r
250 + "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",
\r
268 diff --git a/test/notmuch-test b/test/notmuch-test
\r
269 index ea39dfc..cc732c3 100755
\r
270 --- a/test/notmuch-test
\r
271 +++ b/test/notmuch-test
\r
272 @@ -59,6 +59,7 @@ TESTS="
\r
273 emacs-address-cleaning
\r
278 TESTS=${NOTMUCH_TESTS:=$TESTS}
\r