[PATCH v5 0/9] notmuch search date:since..until query support
[notmuch-archives.git] / 02 / 67352517a4958c92f4639e80dc714d484a739e
1 Return-Path: <jrollins@servo.finestructure.net>\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 3D132431FB6\r
6         for <notmuch@notmuchmail.org>; Sun,  5 Jun 2011 17:29:40 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.921\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5\r
12         tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3]\r
13         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 YCZtUBymEPmc for <notmuch@notmuchmail.org>;\r
17         Sun,  5 Jun 2011 17:29:38 -0700 (PDT)\r
18 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
19         [131.215.239.19])\r
20         by olra.theworths.org (Postfix) with ESMTP id CB89A429E27\r
21         for <notmuch@notmuchmail.org>; Sun,  5 Jun 2011 17:29:37 -0700 (PDT)\r
22 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
23         by earth-doxen-postvirus (Postfix) with ESMTP id 20A6466E027D;\r
24         Sun,  5 Jun 2011 17:29:36 -0700 (PDT)\r
25 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
26 Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com\r
27         [98.149.172.122]) (Authenticated sender: jrollins)\r
28         by earth-doxen-submit (Postfix) with ESMTP id A65F666E010B;\r
29         Sun,  5 Jun 2011 17:29:30 -0700 (PDT)\r
30 Received: by servo.finestructure.net (Postfix, from userid 1000)\r
31         id 1DA801A9; Sun,  5 Jun 2011 17:29:31 -0700 (PDT)\r
32 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
33 To: Notmuch Mail <notmuch@notmuchmail.org>\r
34 Subject: [PATCH 2/5] test: Fix date in test message in multipart test.\r
35 Date: Sun,  5 Jun 2011 17:29:26 -0700\r
36 Message-Id: <1307320169-29905-3-git-send-email-jrollins@finestructure.net>\r
37 X-Mailer: git-send-email 1.7.4.4\r
38 In-Reply-To: <1307320169-29905-2-git-send-email-jrollins@finestructure.net>\r
39 References: <87sjrsi2b4.fsf@servo.factory.finestructure.net>\r
40         <1307320169-29905-1-git-send-email-jrollins@finestructure.net>\r
41         <1307320169-29905-2-git-send-email-jrollins@finestructure.net>\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Mon, 06 Jun 2011 00:29:40 -0000\r
55 \r
56 The test message date, "Tue, 05 Jan 2001 15:43:57 -0000", is not\r
57 actually a real date.  05 Jan 2001 was in fact a Friday, not a\r
58 Tuesday.  Date parsers (such as "date" in coreutils) will return "Fri"\r
59 as the day for this string, even if "Tue" is specified.\r
60 \r
61 Also, the time zone "-0000" is actually always returned as "+0000", so\r
62 we change that here was well.\r
63 \r
64 This will be relevant for later patches when we begin parsing rfc822\r
65 part headers, where gmime returns a parsed date string.\r
66 \r
67 If we do want to test date parsing, we should do that in a separate\r
68 test.\r
69 ---\r
70  test/multipart |   12 ++++++------\r
71  1 files changed, 6 insertions(+), 6 deletions(-)\r
72 \r
73 diff --git a/test/multipart b/test/multipart\r
74 index 9d6a9d1..67e04d9 100755\r
75 --- a/test/multipart\r
76 +++ b/test/multipart\r
77 @@ -6,7 +6,7 @@ cat <<EOF > ${MAIL_DIR}/multipart\r
78  From: Carl Worth <cworth@cworth.org>\r
79  To: cworth@cworth.org\r
80  Subject: Multipart message\r
81 -Date: Tue, 05 Jan 2001 15:43:57 -0000\r
82 +Date: Fri, 05 Jan 2001 15:43:57 +0000\r
83  User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)\r
84  Message-ID: <87liy5ap00.fsf@yoom.home.cworth.org>\r
85  MIME-Version: 1.0\r
86 @@ -23,7 +23,7 @@ Content-Disposition: inline\r
87  From: Carl Worth <cworth@cworth.org>\r
88  To: cworth@cworth.org\r
89  Subject: html message\r
90 -Date: Tue, 05 Jan 2001 15:42:57 -0000\r
91 +Date: Fri, 05 Jan 2001 15:42:57 +0000\r
92  User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)\r
93  Message-ID: <87liy5ap01.fsf@yoom.home.cworth.org>\r
94  MIME-Version: 1.0\r
95 @@ -61,7 +61,7 @@ cat <<EOF > ${MAIL_DIR}/base64-part-with-crlf\r
96  From: Carl Worth <cworth@cworth.org>\r
97  To: cworth@cworth.org\r
98  Subject: Test message with a BASE64 encoded binary containing CRLF pair\r
99 -Date: Tue, 05 Jan 2001 15:43:57 -0000\r
100 +Date: Fri, 05 Jan 2001 15:43:57 +0000\r
101  User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)\r
102  Message-ID: <base64-part-with-crlf>\r
103  MIME-Version: 1.0\r
104 @@ -100,7 +100,7 @@ Carl Worth <cworth@cworth.org> (2001-01-05) (attachment inbox signed unread)\r
105  Subject: Multipart message\r
106  From: Carl Worth <cworth@cworth.org>\r
107  To: cworth@cworth.org\r
108 -Date: Tue, 05 Jan 2001 15:43:57 -0000\r
109 +Date: Fri, 05 Jan 2001 15:43:57 +0000\r
110  \f\r
111 header}\r
112  \f\r
113 body{\r
114  \f\r
115 part{ ID: 1, Content-type: multipart/signed\r
116 @@ -235,7 +235,7 @@ test_expect_success \\r
117  test_begin_subtest "--format=json --part=0, full message"\r
118  output=$(notmuch show --format=json --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org')\r
119  test_expect_equal "$output" \\r
120 -'{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "filename": "'"${MAIL_DIR}/multipart"'", "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Cc": "", "Bcc": "", "Date": "Tue, 05 Jan 2001 15:43:57 -0000"}, "body": [{"id": 1, "content-type": "multipart/signed", "content": [{"id": 2, "content-type": "multipart/mixed", "content": [{"id": 3, "content-type": "message/rfc822", "content": [{"id": 4, "content-type": "text/html"}]}, {"id": 5, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"}, {"id": 6, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}]}, {"id": 7, "content-type": "application/pgp-signature"}]}]}'\r
121 +'{"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "filename": "'"${MAIL_DIR}/multipart"'", "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Cc": "", "Bcc": "", "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [{"id": 1, "content-type": "multipart/signed", "content": [{"id": 2, "content-type": "multipart/mixed", "content": [{"id": 3, "content-type": "message/rfc822", "content": [{"id": 4, "content-type": "text/html"}]}, {"id": 5, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"}, {"id": 6, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}]}, {"id": 7, "content-type": "application/pgp-signature"}]}]}'\r
122  \r
123  test_begin_subtest "--format=json --part=1, message body"\r
124  output=$(notmuch show --format=json --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org')\r
125 @@ -385,7 +385,7 @@ To: Carl Worth <cworth@cworth.org>, cworth@cworth.org\r
126  In-Reply-To: <87liy5ap00.fsf@yoom.home.cworth.org>\r
127  References: <87liy5ap00.fsf@yoom.home.cworth.org>\r
128  \r
129 -On Tue, 05 Jan 2001 15:43:57 -0000, Carl Worth <cworth@cworth.org> wrote:\r
130 +On Fri, 05 Jan 2001 15:43:57 +0000, Carl Worth <cworth@cworth.org> wrote:\r
131  Non-text part: multipart/signed\r
132  Non-text part: multipart/mixed\r
133  Non-text part: message/rfc822\r
134 -- \r
135 1.7.4.4\r
136 \r