[Pkg] The Trunk: KernelTests-nice.223.mcz

commits at source.squeak.org commits at source.squeak.org
Sat May 26 17:37:32 UTC 2012


Nicolas Cellier uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-nice.223.mcz

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

Name: KernelTests-nice.223
Author: nice
Time: 26 May 2012, 7:36:21.885 pm
UUID: 27c70a24-3bf7-40b0-ad12-a09f140c4f84
Ancestors: KernelTests-nice.221

Simplify TimeTest
- readFrom: (ReadStream on: ...) is exactly #readFromString: so just use it
- no reason to use ReadWriteStream when WriteStream does the job

=============== Diff against KernelTests-nice.221 ===============

Item was changed:
  ----- Method: TimeTest>>testAddSeconds (in category 'testing') -----
  testAddSeconds
+ 	self assert: (aTime addSeconds: 1) = (Time readFromString: '12:34:57').
+ 	self assert: (aTime addSeconds: 60) = (Time readFromString: '12:35:56').	
+ 	self assert: (aTime addSeconds: 3600) = (Time readFromString: '13:34:56').
+ 	self assert: (aTime addSeconds: 24*60*60) = (Time readFromString: '12:34:56').!
- 	self assert: (aTime addSeconds: 1) = (Time readFrom: (ReadStream on: '12:34:57')).
- 	self assert: (aTime addSeconds: 60) = (Time readFrom: (ReadStream on: '12:35:56')).	
- 	self assert: (aTime addSeconds: 3600) = (Time readFrom: (ReadStream on: '13:34:56')).
- 	self assert: (aTime addSeconds: 24*60*60) = (Time readFrom: (ReadStream on: '12:34:56')).!

Item was changed:
  ----- Method: TimeTest>>testAddTime (in category 'testing') -----
  testAddTime
+ 	self assert: (aTime addTime: aTime) = (Time readFromString: '01:09:52').
- 	self assert: (aTime addTime: aTime) = (Time readFrom: (ReadStream on: '01:09:52')).
  !

Item was changed:
  ----- Method: TimeTest>>testEqual (in category 'testing') -----
  testEqual
+ 	self assert: aTime = (Time readFromString: '12:34:56').!
- 	self assert: aTime = (Time readFrom: (ReadStream on: '12:34:56')).!

Item was changed:
  ----- Method: TimeTest>>testLessThan (in category 'testing') -----
  testLessThan
+ 	self assert: aTime < (Time readFromString: '12:34:57').!
- 	self assert: aTime < (Time readFrom: (ReadStream on: '12:34:57')).!

Item was changed:
  ----- Method: TimeTest>>testPrint24On (in category 'testing') -----
  testPrint24On
+ 	| referenceString printed |
+ 	referenceString := '12:34:56'.
+ 	printed := WriteStream on: ''.
+ 	aTime print24: true on: printed.
+ 	self assert: printed contents = referenceString!
- 	| cs rw |
- 	cs := ReadStream on: '12:34:56'.
- 	rw := ReadWriteStream on: ''.
- 	aTime print24: true on: rw.
- 	self assert: rw contents = cs contents!

Item was changed:
  ----- Method: TimeTest>>testPrint24OnWithPM (in category 'testing') -----
  testPrint24OnWithPM
+ 	| referenceString printed |
+ 	referenceString := '12:34:56 pm'.
+ 	printed := WriteStream on: ''.
+ 	aTime print24: false on: printed.
+ 	^ self assert: printed contents = referenceString!
- 	| cs rw |
- 	cs := ReadStream on: '12:34:56 pm'.
- 	rw := ReadWriteStream on: ''.
- 	aTime print24: false on: rw.
- 	^ self assert: rw contents = cs contents!

Item was changed:
  ----- Method: TimeTest>>testPrint24OnWithoutSeconds (in category 'testing') -----
  testPrint24OnWithoutSeconds
+ 	| referenceString printed |
+ 	referenceString := '12:34'.
+ 	printed := WriteStream on: ''.
+ 	aTime print24: true showSeconds: false on: printed.
+ 	self assert: printed contents = referenceString!
- 	| cs rw |
- 	cs := ReadStream on: '12:34:56'.
- 	rw := ReadWriteStream on: ''.
- 	aTime print24: true showSeconds: true on: rw.
- 	self assert: rw contents = cs contents!

Item was changed:
  ----- Method: TimeTest>>testPrintOn (in category 'testing') -----
  testPrintOn
+ 	| referenceString printed |
+ 	referenceString := '12:34:56 pm'.
+ 	printed := WriteStream on: ''.
+ 	aTime printOn: printed.
+ 	self assert: printed contents = referenceString!
- 	| cs rw |
- 	cs := ReadStream on: '12:34:56 pm'.
- 	rw := ReadWriteStream on: ''.
- 	aTime printOn: rw.
- 	self assert: rw contents = cs contents!

Item was changed:
  ----- Method: TimeTest>>testStoreOn (in category 'testing') -----
  testStoreOn
+ 	| referenceString stored |
+ 	referenceString := '''12:34:56 pm'' asTime'.
+ 	stored := WriteStream on: ''.
+ 	aTime storeOn: stored.
+ 	self assert: stored contents = referenceString!
- 	| cs rw |
- 	cs := ReadStream on: '''12:34:56 pm'' asTime'.
- 	rw := ReadWriteStream on: ''.
- 	aTime storeOn: rw.
- 	self assert: rw contents = cs contents!



More information about the Packages mailing list