[squeak-dev] The Trunk: Chronology-Tests-dtl.31.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Sep 6 16:04:12 UTC 2022
David T. Lewis uploaded a new version of Chronology-Tests to project The Trunk:
http://source.squeak.org/trunk/Chronology-Tests-dtl.31.mcz
==================== Summary ====================
Name: Chronology-Tests-dtl.31
Author: dtl
Time: 19 May 2022, 12:04:32.792923 pm
UUID: ed1a302a-660e-4fc1-bdf7-6afb9b82fc90
Ancestors: Chronology-Tests-ct.30
Test updates to support Chronology-Core-dtl.80. Change DateAndTime>>offset: to be compliant with the ANSI draft spec. The offset: method should answer an instance equivalent to the receiver, where equivalent means having the same UTC time.
=============== Diff against Chronology-Tests-ct.30 ===============
Item was changed:
----- Method: DateAndTimeEpochTest>>testOffset (in category 'tests') -----
testOffset
self assert: aDateAndTime offset = '0:00:00:00' asDuration.
+ self assert: (aDateAndTime asLocalAt: '0:12:00:00') = '1901-01-01T00:00:00+12:00' asDateAndTime!
- self assert: (aDateAndTime offset: '0:12:00:00') = '1901-01-01T00:00:00+12:00' asDateAndTime!
Item was added:
+ ----- Method: DateAndTimeLeapTest>>testAsLocalAt (in category 'testing') -----
+ testAsLocalAt
+ self assert: aDateAndTime offset = '0:02:00:00' asDuration.
+ self assert: (aDateAndTime asLocalAt: '0:12:00:00') = '2004-02-29T13:33:00+12:00' asDateAndTime!
Item was changed:
----- Method: DateAndTimeLeapTest>>testAsTimeStamp (in category 'testing') -----
testAsTimeStamp
+ self assert: aDateAndTime asTimeStamp = ((TimeStamp readFrom: '2-29-2004 1:33 pm' readStream) asLocalAt: 2 hours).
- self assert: aDateAndTime asTimeStamp = ((TimeStamp readFrom: '2-29-2004 1:33 pm' readStream) offset: 2 hours).
!
Item was changed:
----- Method: DateAndTimeLeapTest>>testOffset (in category 'testing') -----
testOffset
self assert: aDateAndTime offset = '0:02:00:00' asDuration.
+ self assert: (aDateAndTime offset: '0:12:00:00') = '2004-02-29T23:33:00+12:00' asDateAndTime!
- self assert: (aDateAndTime offset: '0:12:00:00') = '2004-02-29T13:33:00+12:00' asDateAndTime!
Item was changed:
----- Method: DateAndTimeLeapTest>>testYearDayHourMinuteSecond (in category 'testing') -----
testYearDayHourMinuteSecond
+ self assert: aDateAndTime = ((DateAndTime year: 2004 day: 60 hour: 13 minute: 33 second: 0) asLocalAt: 2 hours).
- self assert: aDateAndTime = ((DateAndTime year: 2004 day: 60 hour: 13 minute: 33 second: 0) offset: 2 hours).
!
Item was changed:
----- Method: DateAndTimeLeapTest>>testYearMonthDayHourMinuteSecond (in category 'testing') -----
testYearMonthDayHourMinuteSecond
+ self assert: aDateAndTime = ((DateAndTime year: 2004 month: 2 day: 29 hour: 13 minute: 33 second: 0) asLocalAt: 2 hours).
- self assert: aDateAndTime = ((DateAndTime year: 2004 month: 2 day: 29 hour: 13 minute: 33 second: 0) offset: 2 hours).
!
Item was changed:
----- Method: DateTest>>testMakeUTC (in category 'testing') -----
testMakeUTC
"Equal dates should compare equal regardless of which TimeZone they are created in."
| priorTz priorPreference march31stLocal march31stOcean |
priorTz := DateAndTime localTimeZone.
priorPreference := DateAndTime automaticTimezone.
[DateAndTime
localTimeZone: (TimeZone
offset: 9 hours
name: 'Early Test Countries'
abbreviation: 'Test Ocean Early').
march31stLocal := Date year: 2016 month: 3 day: 31.
+ march31stLocal start: (march31stLocal start asLocalAt: DateAndTime localTimeZone offset).
- march31stLocal start: (march31stLocal start offset: DateAndTime localTimeZone offset).
DateAndTime
localTimeZone: (TimeZone
offset: -9 hours
name: 'Late Test Countries'
abbreviation: 'Test Ocean Late').
march31stOcean := Date year: 2016 month: 3 day: 31.
+ march31stOcean start: (march31stOcean start asLocalAt: DateAndTime localTimeZone offset).]
- march31stOcean start: (march31stOcean start offset: DateAndTime localTimeZone offset).]
ensure: [DateAndTime localTimeZone: priorTz.
DateAndTime automaticTimezone: priorPreference].
self
deny: march31stLocal = march31stOcean;
assert: march31stOcean > march31stLocal.
self
assert: march31stLocal makeUTC = march31stOcean makeUTC;
deny: march31stOcean makeUTC > march31stLocal makeUTC;
deny: march31stOcean makeUTC < march31stLocal makeUTC.!
Item was changed:
----- Method: YearTest>>testCurrent (in category 'Tests') -----
testCurrent
self assert:
Year current start =
((DateAndTime
year: DateAndTime now year
month: 1
+ day: 1) asLocalAt: Year defaultOffset)!
- day: 1) offset: Year defaultOffset)!
More information about the Squeak-dev
mailing list
|