unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michal Sojka <sojkam1@fel.cvut.cz>
To: Jani Nikula <jani@nikula.org>,
	notmuch@notmuchmail.org, David Bremner <david@tethera.net>
Subject: Re: [PATCH] test: Improve tests for the date/time parser module
Date: Thu, 04 Oct 2012 13:02:28 +0200	[thread overview]
Message-ID: <87obkifqkb.fsf@steelpick.2x.cz> (raw)
In-Reply-To: <87lifn47qn.fsf@nikula.org>

On Wed, Oct 03 2012, Jani Nikula wrote:
> On Tue, 25 Sep 2012, Michal Sojka <sojkam1@fel.cvut.cz> wrote:
>> This patch reworks date/time parser library test program to make it
>> easier to to write the actual tests. It also modifies the notmuch test
>> script and adds several new tests to it.
>

[...]

>>  	case 'n':
>> -	    /* specify now in seconds since epoch */
>> -	    now = (time_t) strtol (optarg, NULL, 10);
>> +	    memset (&tm, 0, sizeof (tm));
>> +	    char *parsed = strptime (optarg, format, &tm);
>
> One of the problems with strptime is that it doesn't support time zones,
> which is why I chose not to use it here. (You can specify %z in the
> format to ignore it, but it looks like it's ignored no matter
> what. *shrug*) Combined with mktime below, you introduce possible TZ and
> DST variations in the tests, which can be problematic. So perhaps we
> should keep the reference time as a timestamp here.

I didn't pay much attention to time zone issues when writing this little
program, so you might be true. But note that test-lib.sh sets TZ=UTC and
I hope that this should eliminate the problems. I think that it is
better to have human understandable values in test scripts.

-Michal

  reply	other threads:[~2012-10-04 11:02 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 21:27 [PATCH v3 0/9] notmuch search date:since..until query support Jani Nikula
2012-09-12 21:27 ` [PATCH v3 1/9] build: drop the -Wswitch-enum warning Jani Nikula
2012-09-12 21:27 ` [PATCH v3 2/9] parse-time-string: add a date/time parser to notmuch Jani Nikula
2012-09-13 11:10   ` Michal Nazarewicz
2012-09-13 12:07     ` Jani Nikula
2012-09-17 14:13       ` Michal Nazarewicz
2012-09-17 15:54         ` Jani Nikula
2012-09-13 12:48     ` Tomi Ollila
2012-09-25 11:56   ` Michal Sojka
2012-10-03 18:49     ` Jani Nikula
2012-10-03 19:02       ` Michal Sojka
2012-09-12 21:27 ` [PATCH v3 3/9] test: add new test tool parse-time for date/time parser Jani Nikula
2012-09-12 21:27 ` [PATCH v3 4/9] test: add smoke tests for the date/time parser module Jani Nikula
2012-09-25 12:05   ` [PATCH] test: Improve " Michal Sojka
2012-10-03 20:32     ` Jani Nikula
2012-10-04 11:02       ` Michal Sojka [this message]
2012-09-12 21:27 ` [PATCH v3 5/9] build: build parse-time-string as part of the notmuch lib and static cli Jani Nikula
2012-09-12 21:27 ` [PATCH v3 6/9] lib: add date range query support Jani Nikula
2012-09-13 11:14   ` Michal Nazarewicz
2012-09-13 11:32     ` Tomi Ollila
2012-09-13 13:33       ` Jani Nikula
2012-09-17 15:11         ` Michal Nazarewicz
2012-09-13 12:32     ` David Bremner
2012-09-17 15:03       ` Michal Nazarewicz
2012-09-17 15:35         ` Tomi Ollila
2012-09-17 16:10         ` David Bremner
2012-09-25 12:15     ` Michal Sojka
2012-09-12 21:27 ` [PATCH v3 7/9] test: add tests for date:since..until range queries Jani Nikula
2012-09-12 21:27 ` [PATCH v3 8/9] man: document the " Jani Nikula
2012-09-12 21:27 ` [PATCH v3 9/9] NEWS: date range search support Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87obkifqkb.fsf@steelpick.2x.cz \
    --to=sojkam1@fel.cvut.cz \
    --cc=david@tethera.net \
    --cc=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).