[PATCH v2 4/7] test: add smoke tests for the date/time parser module
authorJani Nikula <jani@nikula.org>
Sat, 4 Aug 2012 07:41:42 +0000 (10:41 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:50 +0000 (09:48 -0800)
e4/f0913770ce99bbe3902c49615383861b999c8c [new file with mode: 0644]

diff --git a/e4/f0913770ce99bbe3902c49615383861b999c8c b/e4/f0913770ce99bbe3902c49615383861b999c8c
new file mode 100644 (file)
index 0000000..809878e
--- /dev/null
@@ -0,0 +1,123 @@
+Return-Path: <jani@nikula.org>\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 1F483431FAF\r
+       for <notmuch@notmuchmail.org>; Sat,  4 Aug 2012 00:42:18 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 dT5EfMqXj2q8 for <notmuch@notmuchmail.org>;\r
+       Sat,  4 Aug 2012 00:42:17 -0700 (PDT)\r
+Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
+       [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 136B4431FB6\r
+       for <notmuch@notmuchmail.org>; Sat,  4 Aug 2012 00:42:11 -0700 (PDT)\r
+Received: by mail-lpp01m010-f53.google.com with SMTP id u2so844636lag.26\r
+       for <notmuch@notmuchmail.org>; Sat, 04 Aug 2012 00:42:11 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references\r
+       :in-reply-to:references:x-gm-message-state;\r
+       bh=K2h8eZUVEdZbrnEpiZbcEcyx5LQQeN85uxP8CQLF7H4=;\r
+       b=pSPDLyvEqaCxsmWdP+vvEXqq/2BsqZf40V192iLsusqmcLqLgfjgwYSkIh907gNVFC\r
+       YLektxJCwEQjeZd0vP9vNe54YtMXx4tAgikRCo9GXj6m5NKBmy2GiQUMdezHjlcroQYA\r
+       isQ5924TKsl0PhSlzfc/U0tQ/D8CIPYA/N1yQb25LM0t12meNKR807Z+3w+qdAAcbvh7\r
+       Ej6Wsgi5cwEFajFgYKTrpWH/WQGsVeHP10SVhyhNDn2Ocq2Z+OLpkSQdrJnIHOvzz+dA\r
+       Bqx7o0vaeNn0z4uctJ9er+bkXA3bP9d6HNkHtm61aIWPty0M3r1gNuXiVq13GT0/WHTK\r
+       fh+g==\r
+Received: by 10.152.112.34 with SMTP id in2mr4012182lab.6.1344066131637;\r
+       Sat, 04 Aug 2012 00:42:11 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi.\r
+       [80.223.81.27])\r
+       by mx.google.com with ESMTPS id sy1sm10831134lab.13.2012.08.04.00.42.09\r
+       (version=SSLv3 cipher=OTHER); Sat, 04 Aug 2012 00:42:10 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 4/7] test: add smoke tests for the date/time parser module\r
+Date: Sat,  4 Aug 2012 10:41:42 +0300\r
+Message-Id:\r
+ <76bd571d6a70b7714a6e295ba532b1db023c1b5b.1344065790.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.9.5\r
+In-Reply-To: <cover.1344065790.git.jani@nikula.org>\r
+References: <cover.1344065790.git.jani@nikula.org>\r
+In-Reply-To: <cover.1344065790.git.jani@nikula.org>\r
+References: <cover.1344065790.git.jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQk22uq62lqLjjZ77G7Evlux2RunFsSZVNSNACMStyJqI1yRZa516dA5qDtlQLOvVOrbtlXt\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: Sat, 04 Aug 2012 07:42:18 -0000\r
+\r
+Test the date/time parser module directly. Just a small sanity test\r
+initially.\r
+---\r
+ test/notmuch-test      |    1 +\r
+ test/parse-time-string |   26 ++++++++++++++++++++++++++\r
+ 2 files changed, 27 insertions(+)\r
+ create mode 100755 test/parse-time-string\r
+\r
+diff --git a/test/notmuch-test b/test/notmuch-test\r
+index ea39dfc..80e687e 100755\r
+--- a/test/notmuch-test\r
++++ b/test/notmuch-test\r
+@@ -59,6 +59,7 @@ TESTS="\r
+   emacs-address-cleaning\r
+   emacs-hello\r
+   emacs-show\r
++  parse-time-string\r
+ "\r
+ TESTS=${NOTMUCH_TESTS:=$TESTS}\r
\r
+diff --git a/test/parse-time-string b/test/parse-time-string\r
+new file mode 100755\r
+index 0000000..34b80d7\r
+--- /dev/null\r
++++ b/test/parse-time-string\r
+@@ -0,0 +1,26 @@\r
++#!/usr/bin/env bash\r
++test_description="date/time parser module"\r
++. ./test-lib.sh\r
++\r
++# This is currently just a quick sanity/smoke test.\r
++\r
++_date ()\r
++{\r
++    date -d "$*" +%s\r
++}\r
++\r
++_parse_time ()\r
++{\r
++    ${TEST_DIRECTORY}/parse-time --format=%s "$*"\r
++}\r
++\r
++test_begin_subtest "date(1) default format without TZ code"\r
++test_expect_equal "$(_parse_time Fri Aug 3 23:06:06 2012)" "$(_date Fri Aug 3 23:06:06 2012)"\r
++\r
++test_begin_subtest "date(1) --rfc-2822 format"\r
++test_expect_equal "$(_parse_time Fri, 03 Aug 2012 23:07:46 +0100)" "$(_date Fri, 03 Aug 2012 23:07:46 +0100)"\r
++\r
++test_begin_subtest "date(1) --rfc=3339=seconds format"\r
++test_expect_equal "$(_parse_time 2012-08-03 23:09:37+03:00)" "$(_date 2012-08-03 23:09:37+03:00)"\r
++\r
++test_done\r
+-- \r
+1.7.9.5\r
+\r