On 05 Jun 2012, at 08:55, Pavel Krivanek wrote:

> Thank you, Tests Guard page updated
> http://code.google.com/p/pharo/wiki/TestsGuard

How did TimeTest>>#testGeneralInquiries get in there ?

I looked at it and I can't imagine why this would randomly fail on Mac OS X. 
But everything is possible.

Maybe something with time zones, but as far as I can see, both date parsing and 
date creation from seconds use the local time zone.

As for the test code itself,

testGeneralInquiries
        | now d t dt |

        now  := self timeClass dateAndTimeNow.
        self 
                assert: now size = 2;
                assert: now last <= self timeClass now.

        self should: [ self timeClass timeWords ] raise: MessageNotUnderstood.

        d := '2 June 1973' asDate.
        t := '4:02:47 am' asTime.
        dt := self timeClass dateAndTimeFromSeconds: (2285280000 + 14567).
        self
                assert: dt = {d. t.}.


The middle part is a GREAT example of a useful unit test…

Sven 

Reply via email to