[PATCH 2/5] test: Fix date in test message in multipart test.
authorJameson Graef Rollins <jrollins@finestructure.net>
Mon, 6 Jun 2011 00:29:26 +0000 (17:29 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:33 +0000 (09:38 -0800)
02/67352517a4958c92f4639e80dc714d484a739e [new file with mode: 0644]

diff --git a/02/67352517a4958c92f4639e80dc714d484a739e b/02/67352517a4958c92f4639e80dc714d484a739e
new file mode 100644 (file)
index 0000000..60d7a93
--- /dev/null
@@ -0,0 +1,136 @@
+Return-Path: <jrollins@servo.finestructure.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 3D132431FB6\r
+       for <notmuch@notmuchmail.org>; Sun,  5 Jun 2011 17:29:40 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.921\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5\r
+       tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id YCZtUBymEPmc for <notmuch@notmuchmail.org>;\r
+       Sun,  5 Jun 2011 17:29:38 -0700 (PDT)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+       [131.215.239.19])\r
+       by olra.theworths.org (Postfix) with ESMTP id CB89A429E27\r
+       for <notmuch@notmuchmail.org>; Sun,  5 Jun 2011 17:29:37 -0700 (PDT)\r
+Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by earth-doxen-postvirus (Postfix) with ESMTP id 20A6466E027D;\r
+       Sun,  5 Jun 2011 17:29:36 -0700 (PDT)\r
+X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
+Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com\r
+       [98.149.172.122]) (Authenticated sender: jrollins)\r
+       by earth-doxen-submit (Postfix) with ESMTP id A65F666E010B;\r
+       Sun,  5 Jun 2011 17:29:30 -0700 (PDT)\r
+Received: by servo.finestructure.net (Postfix, from userid 1000)\r
+       id 1DA801A9; Sun,  5 Jun 2011 17:29:31 -0700 (PDT)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH 2/5] test: Fix date in test message in multipart test.\r
+Date: Sun,  5 Jun 2011 17:29:26 -0700\r
+Message-Id: <1307320169-29905-3-git-send-email-jrollins@finestructure.net>\r
+X-Mailer: git-send-email 1.7.4.4\r
+In-Reply-To: <1307320169-29905-2-git-send-email-jrollins@finestructure.net>\r
+References: <87sjrsi2b4.fsf@servo.factory.finestructure.net>\r
+       <1307320169-29905-1-git-send-email-jrollins@finestructure.net>\r
+       <1307320169-29905-2-git-send-email-jrollins@finestructure.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 06 Jun 2011 00:29:40 -0000\r
+\r
+The test message date, "Tue, 05 Jan 2001 15:43:57 -0000", is not\r
+actually a real date.  05 Jan 2001 was in fact a Friday, not a\r
+Tuesday.  Date parsers (such as "date" in coreutils) will return "Fri"\r
+as the day for this string, even if "Tue" is specified.\r
+\r
+Also, the time zone "-0000" is actually always returned as "+0000", so\r
+we change that here was well.\r
+\r
+This will be relevant for later patches when we begin parsing rfc822\r
+part headers, where gmime returns a parsed date string.\r
+\r
+If we do want to test date parsing, we should do that in a separate\r
+test.\r
+---\r
+ test/multipart |   12 ++++++------\r
+ 1 files changed, 6 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/test/multipart b/test/multipart\r
+index 9d6a9d1..67e04d9 100755\r
+--- a/test/multipart\r
++++ b/test/multipart\r
+@@ -6,7 +6,7 @@ cat <<EOF > ${MAIL_DIR}/multipart\r
+ From: Carl Worth <cworth@cworth.org>\r
+ To: cworth@cworth.org\r
+ Subject: Multipart message\r
+-Date: Tue, 05 Jan 2001 15:43:57 -0000\r
++Date: Fri, 05 Jan 2001 15:43:57 +0000\r
+ User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)\r
+ Message-ID: <87liy5ap00.fsf@yoom.home.cworth.org>\r
+ MIME-Version: 1.0\r
+@@ -23,7 +23,7 @@ Content-Disposition: inline\r
+ From: Carl Worth <cworth@cworth.org>\r
+ To: cworth@cworth.org\r
+ Subject: html message\r
+-Date: Tue, 05 Jan 2001 15:42:57 -0000\r
++Date: Fri, 05 Jan 2001 15:42:57 +0000\r
+ User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)\r
+ Message-ID: <87liy5ap01.fsf@yoom.home.cworth.org>\r
+ MIME-Version: 1.0\r
+@@ -61,7 +61,7 @@ cat <<EOF > ${MAIL_DIR}/base64-part-with-crlf\r
+ From: Carl Worth <cworth@cworth.org>\r
+ To: cworth@cworth.org\r
+ Subject: Test message with a BASE64 encoded binary containing CRLF pair\r
+-Date: Tue, 05 Jan 2001 15:43:57 -0000\r
++Date: Fri, 05 Jan 2001 15:43:57 +0000\r
+ User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)\r
+ Message-ID: <base64-part-with-crlf>\r
+ MIME-Version: 1.0\r
+@@ -100,7 +100,7 @@ Carl Worth <cworth@cworth.org> (2001-01-05) (attachment inbox signed unread)\r
+ Subject: Multipart message\r
+ From: Carl Worth <cworth@cworth.org>\r
+ To: cworth@cworth.org\r
+-Date: Tue, 05 Jan 2001 15:43:57 -0000\r
++Date: Fri, 05 Jan 2001 15:43:57 +0000\r
\f\r
+header}\r
\f\r
+body{\r
\f\r
+part{ ID: 1, Content-type: multipart/signed\r
+@@ -235,7 +235,7 @@ test_expect_success \\r
+ test_begin_subtest "--format=json --part=0, full message"\r
+ output=$(notmuch show --format=json --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org')\r
+ test_expect_equal "$output" \\r
+-'{"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
++'{"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
\r
+ test_begin_subtest "--format=json --part=1, message body"\r
+ output=$(notmuch show --format=json --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org')\r
+@@ -385,7 +385,7 @@ To: Carl Worth <cworth@cworth.org>, cworth@cworth.org\r
+ In-Reply-To: <87liy5ap00.fsf@yoom.home.cworth.org>\r
+ References: <87liy5ap00.fsf@yoom.home.cworth.org>\r
\r
+-On Tue, 05 Jan 2001 15:43:57 -0000, Carl Worth <cworth@cworth.org> wrote:\r
++On Fri, 05 Jan 2001 15:43:57 +0000, Carl Worth <cworth@cworth.org> wrote:\r
+ Non-text part: multipart/signed\r
+ Non-text part: multipart/mixed\r
+ Non-text part: message/rfc822\r
+-- \r
+1.7.4.4\r
+\r