[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] Patch for parsing dates and time
From: |
Paolo Bonzini |
Subject: |
Re: [Help-smalltalk] Patch for parsing dates and time |
Date: |
Mon, 23 Jul 2012 08:26:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 |
I admit I haven't looked at the patch, only the testsuite results.
Il 23/07/2012 04:32, Maarten van Beek ha scritto:
> diff --git a/tests/dates.ok b/tests/dates.ok
> index 1bbfbd6..3e064d1 100644
> --- a/tests/dates.ok
> +++ b/tests/dates.ok
> @@ -830,10 +830,10 @@ Execution begins...
> 1-Feb-2011->'2011-02-01'
> 1-Feb-2011->'Feb 1 2011'
> 1-Feb-2011->'Feb 1 2011'
> -1-Feb--2011->'-2011-02-01'
> -1-Feb--2011->'-2011-02-01'
> -1-Feb--2011->'Feb 1 -2011'
> -1-Feb--2011->'Feb 1 -2011'
> +1-Feb-2011->'-2011-02-01'
> +1-Feb-2011->'-2011-02-01'
> +1-Feb-2011->'Feb 1 -2011'
> +1-Feb-2011->'Feb 1 -2011'
Here the year is "-2011" before your patch and "+2011" after.
> 9:00:02->'09:00:02'
> 9:00:02->'09:00:02'
> 9:00:02->'09:00:02'
> @@ -996,12 +996,12 @@ Execution begins...
> 2011-02-01T00:00:00+00:00->'2011-02-01'
> 2011-02-01T00:00:00+00:00->'Feb 1 2011'
> 2011-02-01T00:00:00+00:00->'Feb 1 2011'
> --2011-02-01T09:00:00+01:30->'-2011-02-01T09:00+01:30'
> --2011-02-01T09:00:00+01:30->'-2011-02-01T09:00+01:30'
> --2011-02-01T00:00:00+00:00->'-2011-02-01'
> --2011-02-01T00:00:00+00:00->'-2011-02-01'
> --2011-02-01T00:00:00+00:00->'Feb 1 -2011'
> --2011-02-01T00:00:00+00:00->'Feb 1 -2011'
> + 2011-02-01T09:00:00+01:30->'-2011-02-01T09:00+01:30'
> + 2011-02-01T09:00:00+01:30->'-2011-02-01T09:00+01:30'
> + 2011-02-01T00:00:00+00:00->'-2011-02-01'
> + 2011-02-01T00:00:00+00:00->'-2011-02-01'
> + 2011-02-01T00:00:00+00:00->'Feb 1 -2011'
> + 2011-02-01T00:00:00+00:00->'Feb 1 -2011'
Same here.
So I'm not sure exactly where the bug is. Can you give an example of
the case where a stream with an added suffix would not contain
this added suffix after the date was parsed?
Also, unfortunately using #position: is not possible in #readFrom:,
because not all Streams support it (think Sockets). However, using
#peek is possible.
Paolo
> 2011-02-01T09:00:00+01:30->'Feb 1 2011 09:00 +01:30'
> 2011-02-01T09:00:00+01:30->'Feb 1 2011 09:00 +01:30'
> 2011-02-01T09:00:00+01:30->'Feb 1 2011 09:00 +01:30'