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

commits at source.squeak.org commits at source.squeak.org
Fri Oct 14 20:04:44 UTC 2011


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

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

Name: KernelTests-nice.204
Author: nice
Time: 14 October 2011, 10:04:18.249 pm
UUID: 8a7e78cf-95dd-4a05-b423-a45b0842443a
Ancestors: KernelTests-nice.203

Add tests for ScaledDecimal sqrt.
Put high expectations on exactness whenever possible.

=============== Diff against KernelTests-nice.203 ===============

Item was added:
+ ----- Method: ScaledDecimalTest>>testExactSqrt (in category 'tests') -----
+ testExactSqrt
+ 	| four hundredth tenth two |
+ 	four := 4.0s1.
+ 	two := four sqrt.
+ 	self assert: two = 2.
+ 	self assert: (two class = four class and: [two scale = four scale]).
+ 	hundredth := 0.01s2.
+ 	tenth := hundredth sqrt.
+ 	self assert: tenth * 10 = 1.
+ 	self assert: (tenth class = hundredth class and: [tenth scale = hundredth scale]).!

Item was added:
+ ----- Method: ScaledDecimalTest>>testInexactSqrt (in category 'tests') -----
+ testInexactSqrt
+ 	| tenth sqrt3 sqrtTenth three |
+ 	three := 3.0s1.
+ 	sqrt3 := three sqrt.
+ 	self assert: sqrt3 class = Float.
+ 	self deny: sqrt3 squared = 3.
+ 	tenth := 0.10s2.
+ 	sqrtTenth := tenth sqrt.
+ 	self assert: sqrtTenth class = Float.
+ 	self deny: sqrtTenth squared = tenth.!




More information about the Squeak-dev mailing list