[squeak-dev] The Trunk: Chronology-Tests-cbc.21.mcz

commits at source.squeak.org commits at source.squeak.org
Wed May 15 02:42:42 UTC 2019


Chris Cunningham uploaded a new version of Chronology-Tests to project The Trunk:
http://source.squeak.org/trunk/Chronology-Tests-cbc.21.mcz

==================== Summary ====================

Name: Chronology-Tests-cbc.21
Author: cbc
Time: 14 May 2019, 7:42:10.341803 pm
UUID: fad4b39a-c038-db49-8e01-8d28ec988120
Ancestors: Chronology-Tests-dtl.20

Fixed DurationTest>>testNormalizeNanoSeconds to match new way of printing partial seconds from Chronology-Core-nice.42

"Always print duration subseconds by group of 3 digits (ms, us, ns)"

=============== Diff against Chronology-Tests-dtl.20 ===============

Item was changed:
  ----- Method: DurationTest>>testNormalizeNanoSeconds (in category 'tests') -----
  testNormalizeNanoSeconds
  	"Subtraction of two DateAndTime values may result in a request to
  	create a Duration with negative nanoseconds and positive seconds.
  	The resulting Duration should be normalized, otherwise its printString
  	will be invalid."
  
  	| d t1 t2 |
  	t1 := '2004-01-07T11:55:01+00:00' asDateAndTime. 
  	t2 := '2004-01-07T11:55:00.9+00:00' asDateAndTime.
  	d := t1 - t2. "100 millisecond difference"
  	self assert: d nanoSeconds > 0.
  	self assert: d seconds = 0.
  	self assert: d nanoSeconds = 100000000.
+ 	self assert: d asString = '0:00:00:00.100'.
- 	self assert: d asString = '0:00:00:00.1'.
  	"Verify that other combinations produces reasonable printString values"
+ 	self assert: (Duration seconds: 1 nanoSeconds: 100000000) printString = '0:00:00:01.100'.
+ 	self assert: (Duration seconds: -1 nanoSeconds: -100000000) printString = '-0:00:00:01.100'.
+ 	self assert: (Duration seconds: 1 nanoSeconds: -100000000) printString = '0:00:00:00.900'.
+ 	self assert: (Duration seconds: -1 nanoSeconds: 100000000) printString = '-0:00:00:00.900'
- 	self assert: (Duration seconds: 1 nanoSeconds: 100000000) printString = '0:00:00:01.1'.
- 	self assert: (Duration seconds: -1 nanoSeconds: -100000000) printString = '-0:00:00:01.1'.
- 	self assert: (Duration seconds: 1 nanoSeconds: -100000000) printString = '0:00:00:00.9'.
- 	self assert: (Duration seconds: -1 nanoSeconds: 100000000) printString = '-0:00:00:00.9'
  !



More information about the Squeak-dev mailing list