[squeak-dev] The Trunk: KernelTests-nice.193.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jun 3 19:41:29 UTC 2011


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

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

Name: KernelTests-nice.193
Author: nice
Time: 3 June 2011, 9:41:10.753 pm
UUID: 525af4ab-6857-482b-9d70-1e94739311ee
Ancestors: KernelTests-eem.192

Add tests for ceiling/floor/truncated/rounded

=============== Diff against KernelTests-eem.192 ===============

Item was added:
+ ----- Method: FloatTest>>testCeiling (in category 'testing - conversion') -----
+ testCeiling
+ 	self assert: 1.0 ceiling = 1.
+ 	self assert: 1.1 ceiling = 2.
+ 	self assert: -2.0 ceiling = -2.
+ 	self assert: -2.1 ceiling = -2.!

Item was added:
+ ----- Method: FloatTest>>testFloor (in category 'testing - conversion') -----
+ testFloor
+ 	self assert: 1.0 floor = 1.
+ 	self assert: 1.1 floor = 1.
+ 	self assert: -2.0 floor = -2.
+ 	self assert: -2.1 floor = -3.!

Item was added:
+ ----- Method: FloatTest>>testRounded (in category 'testing - conversion') -----
+ testRounded
+ 	self assert: 0.9 rounded = 1.
+ 	self assert: 1.0 rounded = 1.
+ 	self assert: 1.1 rounded = 1.
+ 	self assert: -1.9 rounded = -2.
+ 	self assert: -2.0 rounded = -2.
+ 	self assert: -2.1 rounded = -2.
+ 	
+ 	"In case of tie, round to upper magnitude"
+ 	self assert: 1.5 rounded = 2.
+ 	self assert: -1.5 rounded = -2.!

Item was added:
+ ----- Method: FloatTest>>testTruncated (in category 'testing - conversion') -----
+ testTruncated
+ 	self assert: 1.0 truncated = 1.
+ 	self assert: 1.1 truncated = 1.
+ 	self assert: -2.0 truncated = -2.
+ 	self assert: -2.1 truncated = -2.!

Item was added:
+ ----- Method: FractionTest>>testCeiling (in category 'tests - conversions') -----
+ testCeiling
+ 	self assert: (3 / 2) ceiling = 2.
+ 	self assert: (-3 / 2) ceiling = -1.!

Item was added:
+ ----- Method: FractionTest>>testFloor (in category 'tests - conversions') -----
+ testFloor
+ 	self assert: (3 / 2) floor = 1.
+ 	self assert: (-3 / 2) floor = -2.!

Item was added:
+ ----- Method: FractionTest>>testRounded (in category 'tests - conversions') -----
+ testRounded
+ 	self assert: (4 / 5) rounded = 1.
+ 	self assert: (6 / 5) rounded = 1.
+ 	self assert: (-4 / 5) rounded = -1.
+ 	self assert: (-6 / 5) rounded = -1.
+ 	
+ 	"In case of tie, round to upper magnitude"
+ 	self assert: (3 / 2) rounded = 2.
+ 	self assert: (-3 / 2) rounded = -2.!

Item was added:
+ ----- Method: FractionTest>>testTruncated (in category 'tests - conversions') -----
+ testTruncated
+ 	self assert: (3 / 2) truncated = 1.
+ 	self assert: (-3 / 2) truncated = -1.!




More information about the Squeak-dev mailing list