Re: [PATCH] test: Improve tests for the date/time parser module
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 4 Oct 2012 11:02:28 +0000 (13:02 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:43 +0000 (09:49 -0800)
15/9276374756574d61073f7892f4e606a539ee05 [new file with mode: 0644]

diff --git a/15/9276374756574d61073f7892f4e606a539ee05 b/15/9276374756574d61073f7892f4e606a539ee05
new file mode 100644 (file)
index 0000000..0a042e2
--- /dev/null
@@ -0,0 +1,93 @@
+Return-Path: <sojkam1@fel.cvut.cz>\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 042A6431FB6\r
+       for <notmuch@notmuchmail.org>; Thu,  4 Oct 2012 04:02:37 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] 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 XENmEFL1s2C1 for <notmuch@notmuchmail.org>;\r
+       Thu,  4 Oct 2012 04:02:36 -0700 (PDT)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id 63D88431FAE\r
+       for <notmuch@notmuchmail.org>; Thu,  4 Oct 2012 04:02:36 -0700 (PDT)\r
+Received: from localhost (unknown [192.168.200.4])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 3A26019F3353;\r
+       Thu,  4 Oct 2012 13:02:35 +0200 (CEST)\r
+X-Virus-Scanned: IMAP AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+       by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
+       port 10044)\r
+       with ESMTP id TGOyvJK8Uy28; Thu,  4 Oct 2012 13:02:30 +0200 (CEST)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 608EB19F335E;\r
+       Thu,  4 Oct 2012 13:02:29 +0200 (CEST)\r
+Received: from steelpick.2x.cz (rtime.felk.cvut.cz [147.32.86.92])\r
+       (Authenticated sender: sojkam1)\r
+       by imap.feld.cvut.cz (Postfix) with ESMTPSA id DAFC4660969;\r
+       Thu,  4 Oct 2012 13:02:28 +0200 (CEST)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.80)\r
+       (envelope-from <sojkam1@fel.cvut.cz>)\r
+       id 1TJjCG-0004BK-Cf; Thu, 04 Oct 2012 13:02:28 +0200\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org,\r
+       David Bremner <david@tethera.net>\r
+Subject: Re: [PATCH] test: Improve tests for the date/time parser module\r
+In-Reply-To: <87lifn47qn.fsf@nikula.org>\r
+References: <cover.1347484177.git.jani@nikula.org>\r
+       <24186aafbdcb967b8f66c2390c928f3788ab6cbf.1347484177.git.jani@nikula.org>\r
+       <87zk4e1f5k.fsf@steelpick.2x.cz> <87lifn47qn.fsf@nikula.org>\r
+User-Agent: Notmuch/0.14+23~g9d68aca (http://notmuchmail.org) Emacs/24.2.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Thu, 04 Oct 2012 13:02:28 +0200\r
+Message-ID: <87obkifqkb.fsf@steelpick.2x.cz>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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: Thu, 04 Oct 2012 11:02:37 -0000\r
+\r
+On Wed, Oct 03 2012, Jani Nikula wrote:\r
+> On Tue, 25 Sep 2012, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
+>> This patch reworks date/time parser library test program to make it\r
+>> easier to to write the actual tests. It also modifies the notmuch test\r
+>> script and adds several new tests to it.\r
+>\r
+\r
+[...]\r
+\r
+>>     case 'n':\r
+>> -       /* specify now in seconds since epoch */\r
+>> -       now = (time_t) strtol (optarg, NULL, 10);\r
+>> +       memset (&tm, 0, sizeof (tm));\r
+>> +       char *parsed = strptime (optarg, format, &tm);\r
+>\r
+> One of the problems with strptime is that it doesn't support time zones,\r
+> which is why I chose not to use it here. (You can specify %z in the\r
+> format to ignore it, but it looks like it's ignored no matter\r
+> what. *shrug*) Combined with mktime below, you introduce possible TZ and\r
+> DST variations in the tests, which can be problematic. So perhaps we\r
+> should keep the reference time as a timestamp here.\r
+\r
+I didn't pay much attention to time zone issues when writing this little\r
+program, so you might be true. But note that test-lib.sh sets TZ=UTC and\r
+I hope that this should eliminate the problems. I think that it is\r
+better to have human understandable values in test scripts.\r
+\r
+-Michal\r