[squeak-dev] The Trunk: Chronology-Tests-dtl.32.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Sep 6 16:02:23 UTC 2022
David T. Lewis uploaded a new version of Chronology-Tests to project The Trunk:
http://source.squeak.org/trunk/Chronology-Tests-dtl.32.mcz
==================== Summary ====================
Name: Chronology-Tests-dtl.32
Author: dtl
Time: 6 September 2022, 12:02:22.727648 pm
UUID: b75c03f1-bad5-4369-946d-a74e8c6c50a3
Ancestors: Chronology-Tests-ct.31, Chronology-Tests-dtl.31, Chronology-Tests-lrnp.31
Merge Chronology-Tests-lrnp.31 and Chronology-Tests-dtl.31
=============== Diff against Chronology-Tests-ct.31 ===============
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: DurationTest>>testBusyWait (in category 'tests') -----
testBusyWait
| duration start elapsed |
duration := Duration milliSeconds: 1.
start := DateAndTime now.
1000 timesRepeat: [duration busyWait].
+ elapsed := DateAndTime now - start roundTo: duration.
- elapsed := DateAndTime now - start.
+ self assert: elapsed >= (duration * 998).
+ self assert: elapsed <= (duration * 1002).!
- self assert: elapsed >= (duration * 1000).
- self assert: elapsed <= (duration * 1000 * 2).!
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
|