David T. Lewis uploaded a new version of Chronology-Tests to project The Trunk: http://source.squeak.org/trunk/Chronology-Tests-dtl.6.mcz
==================== Summary ====================
Name: Chronology-Tests-dtl.6 Author: dtl Time: 4 December 2016, 11:48:31.846968 am UUID: ec13423f-cc05-4d51-a5be-675cb70c8d7f Ancestors: Chronology-Tests-dtl.5
Three new tests to verify that #asSeconds is symmetric with #fromSeconds: with various offset values. The tests pass.
=============== Diff against Chronology-Tests-dtl.5 ===============
Item was added: + ----- Method: DateAndTimeTest>>testAsSecondsMatchesFromSecondsUsingAnyOffset (in category 'Tests') ----- + testAsSecondsMatchesFromSecondsUsingAnyOffset + "Verify that #asSeconds is symmetric with #fromSeconds: for an instance with + offset that does not match the current local time zone offset." + + | aDateAndTime seconds newDateAndTime | + aDateAndTime := DateAndTime year: 2004 month: 2 day: 29 hour: 13 minute: 33 second: 0 offset: 2 hours. + seconds := aDateAndTime asSeconds. + newDateAndTime := DateAndTime fromSeconds: seconds. + self assert: seconds equals: newDateAndTime asSeconds. + + "Repeat with another offset to ensure coverage" + aDateAndTime := DateAndTime year: 2004 month: 2 day: 29 hour: 13 minute: 33 second: 0 offset: -11 hours. + seconds := aDateAndTime asSeconds. + newDateAndTime := DateAndTime fromSeconds: seconds. + self assert: seconds equals: newDateAndTime asSeconds. + !
Item was added: + ----- Method: DateAndTimeTest>>testAsSecondsMatchesFromSecondsUsingCurrentLocalOffset (in category 'Tests') ----- + testAsSecondsMatchesFromSecondsUsingCurrentLocalOffset + "Verify that #asSeconds is symmetric with #fromSeconds: for an instance with + offset that matches the current local time zone offset." + + | seconds newDateAndTime now | + now := DateAndTime now. + seconds := now asSeconds. + newDateAndTime := DateAndTime fromSeconds: seconds. + self assert: seconds equals: newDateAndTime asSeconds. + !
Item was added: + ----- Method: DateAndTimeTest>>testAsSecondsMatchesFromSecondsUsingZeroOffset (in category 'Tests') ----- + testAsSecondsMatchesFromSecondsUsingZeroOffset + "Verify that #asSeconds is symmetric with #fromSeconds: for an instance with + zero offset as in UTC time." + + | aDateAndTime seconds newDateAndTime | + aDateAndTime := DateAndTime year: 2004 month: 2 day: 29 hour: 13 minute: 33 second: 0 offset: 0 hours. + seconds := aDateAndTime asSeconds. + newDateAndTime := DateAndTime fromSeconds: seconds. + self assert: seconds equals: newDateAndTime asSeconds. + !
packages@lists.squeakfoundation.org