[PATCH v2 06/14] cli/reply: make references header creation easier to follow
[notmuch-archives.git] / 96 / 7fb8e829e919a96a37296425132572eb93f77f
1 Return-Path: <awg@lagos.xvx.ca>\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 26481429E42\r
6         for <notmuch@notmuchmail.org>; Tue, 14 Feb 2012 21:00:51 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 Y263iVy1Pyhz for <notmuch@notmuchmail.org>;\r
16         Tue, 14 Feb 2012 21:00:49 -0800 (PST)\r
17 Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10])\r
18         by olra.theworths.org (Postfix) with ESMTP id E3318431E84\r
19         for <notmuch@notmuchmail.org>; Tue, 14 Feb 2012 21:00:45 -0800 (PST)\r
20 Received: from pd3ml2so-ssvc.prod.shaw.ca ([10.0.141.138])\r
21         by pd4mo1so-svcs.prod.shaw.ca with ESMTP; 14 Feb 2012 22:00:44 -0700\r
22 X-Cloudmark-SP-Filtered: true\r
23 X-Cloudmark-SP-Result: v=1.1 cv=w8ylZ/s5/CpB4NtJ57cq/Y3wf+h+jIFeVVN4WVEh/uc=\r
24         c=1 sm=1\r
25         a=_WI2p0fNmGIA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17\r
26         a=bz-zy3QpAAAA:8 a=7343-z1_AAAA:8 a=k6VnKhIuyadO14Jm798A:9\r
27         a=de4YhIpj-7vJmFtsOvwA:7 a=NFWI-YhVVZsA:10 a=GjjSzUO_F3QA:10\r
28         a=0c-eHkXYtrgA:10 a=pIMJlJgVeHwA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117\r
29 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56])\r
30         by pd3ml2so-dmz.prod.shaw.ca with ESMTP; 14 Feb 2012 22:00:44 -0700\r
31 Received: by lagos.xvx.ca (Postfix, from userid 1000)\r
32         id 83D818004EBA; Tue, 14 Feb 2012 22:00:44 -0700 (MST)\r
33 From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>\r
34 To: notmuch@notmuchmail.org\r
35 Subject: [PATCH v5 1/4] test: Add broken test for the new JSON reply format.\r
36 Date: Tue, 14 Feb 2012 22:00:24 -0700\r
37 Message-Id: <1329282027-29457-2-git-send-email-awg+notmuch@xvx.ca>\r
38 X-Mailer: git-send-email 1.7.5.4\r
39 In-Reply-To: <1329282027-29457-1-git-send-email-awg+notmuch@xvx.ca>\r
40 References: <1329282027-29457-1-git-send-email-awg+notmuch@xvx.ca>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Wed, 15 Feb 2012 05:00:52 -0000\r
54 \r
55 ---\r
56  test/multipart |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++\r
57  1 files changed, 51 insertions(+), 0 deletions(-)\r
58 \r
59 diff --git a/test/multipart b/test/multipart\r
60 index a3036b4..9651568 100755\r
61 --- a/test/multipart\r
62 +++ b/test/multipart\r
63 @@ -589,6 +589,57 @@ Non-text part: text/html\r
64  EOF\r
65  test_expect_equal_file OUTPUT EXPECTED\r
66  \r
67 +test_begin_subtest "'notmuch reply' to a multipart message with json format"\r
68 +notmuch reply --format=json 'id:87liy5ap00.fsf@yoom.home.cworth.org' | notmuch_json_show_sanitize >OUTPUT\r
69 +cat <<EOF >EXPECTED\r
70 +{"reply-headers": {"from": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
71 + "to": "Carl Worth <cworth@cworth.org>,\r
72 + cworth@cworth.org",\r
73 + "subject": "Re: Multipart message",\r
74 + "in-reply-to": "<87liy5ap00.fsf@yoom.home.cworth.org>",\r
75 + "references": " <87liy5ap00.fsf@yoom.home.cworth.org>"},\r
76 + "original": {"id": "XXXXX",\r
77 + "match": false,\r
78 + "filename": "YYYYY",\r
79 + "timestamp": 978709437,\r
80 + "date_relative": "2001-01-05",\r
81 + "tags": ["attachment","inbox","signed","unread"],\r
82 + "headers": {"Subject": "Multipart message",\r
83 + "From": "Carl Worth <cworth@cworth.org>",\r
84 + "To": "cworth@cworth.org",\r
85 + "Date": "Fri,\r
86 + 05 Jan 2001 15:43:57 +0000"},\r
87 + "body": [{"id": 1,\r
88 + "content-type": "multipart/signed",\r
89 + "content": [{"id": 2,\r
90 + "content-type": "multipart/mixed",\r
91 + "content": [{"id": 3,\r
92 + "content-type": "message/rfc822",\r
93 + "content": [{"headers": {"Subject": "html message",\r
94 + "From": "Carl Worth <cworth@cworth.org>",\r
95 + "To": "cworth@cworth.org",\r
96 + "Date": "Fri,\r
97 + 05 Jan 2001 15:42:57 +0000"},\r
98 + "body": [{"id": 4,\r
99 + "content-type": "multipart/alternative",\r
100 + "content": [{"id": 5,\r
101 + "content-type": "text/html"},\r
102 + {"id": 6,\r
103 + "content-type": "text/plain",\r
104 + "content": "This is an embedded message,\r
105 + with a multipart/alternative part.\n"}]}]}]},\r
106 + {"id": 7,\r
107 + "content-type": "text/plain",\r
108 + "filename": "YYYYY",\r
109 + "content": "This is a text attachment.\n"},\r
110 + {"id": 8,\r
111 + "content-type": "text/plain",\r
112 + "content": "And this message is signed.\n\n-Carl\n"}]},\r
113 + {"id": 9,\r
114 + "content-type": "application/pgp-signature"}]}]}}\r
115 +EOF\r
116 +test_expect_equal_file OUTPUT EXPECTED\r
117 +\r
118  test_begin_subtest "'notmuch show --part' does not corrupt a part with CRLF pair"\r
119  notmuch show --format=raw --part=3 id:base64-part-with-crlf > crlf.out\r
120  echo -n -e "\xEF\x0D\x0A" > crlf.expected\r
121 -- \r
122 1.7.5.4\r
123 \r