Levente Uzonyi uploaded a new version of Chronology-Tests to project The Trunk:
http://source.squeak.org/trunk/Chronology-Tests-ul.15.mcz==================== Summary ====================
Name: Chronology-Tests-ul.15
Author: ul
Time: 14 January 2019, 1:18:04.380862 pm
UUID: 31a3ca9d-4c54-4034-9d36-9967644e2d87
Ancestors: Chronology-Tests-dtl.14
- updated DateAndTimeTest >> #testPrecision to be aware of Time's ClockPolicy
=============== Diff against Chronology-Tests-dtl.14 ===============
Item was changed:
----- Method: DateAndTimeTest>>testPrecision (in category 'Tests') -----
testPrecision
"Verify that the clock is returning a value with accuracy of better than 1 second. For now it seems sufficient to get two values and verify they are not the same."
+ | originalClockPolicy |
+ originalClockPolicy := Time clockPolicy.
+ [
+ #(
+ "#acceptPlatformTime is not listed here, because it doesn't guarantee monotoncity."
+ monotonicAllowDuplicates <=
+ monotonicForceMicrosecondIncrement <
+ monotonicForceNanosecondIncrement <
+ ) pairsDo: [ :clockPolicy :comparator |
+ | first second |
+ Time clockPolicy: clockPolicy.
+ first := DateAndTime now.
+ second := DateAndTime now.
+ self
+ assert: (first perform: comparator with: second)
+ description: ('Clock policy {1} didn''t compare with {2}' format: { clockPolicy. comparator }) ] ]
+ ensure: [ Time clockPolicy: originalClockPolicy ]
- self
- assert: (DateAndTime now ~= DateAndTime now)
!