The Trunk: KernelTests-nice.133.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: KernelTests-nice.133.mcz

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

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

Name: KernelTests-nice.133
Author: nice
Time: 13 February 2010, 3:47:38.362 am
UUID: 79bf4c02-939d-9947-b07d-91667c43a1c8
Ancestors: KernelTests-nice.132

Test coercion in case of ScaledDecimal arithmetic.
I expect the same policy for Integer and Fraction.
Rationale: (1/1) is a Fraction represented as an Integer, so we cannot really dissociate the two behaviors.

=============== Diff against KernelTests-nice.132 ===============

Item was added:
+ ----- Method: ScaledDecimalTest>>testCoercion (in category 'tests') -----
+ testCoercion
+ #( #* #+ #- #/) do: [:op |
+ self assert: (1.0s1 perform: op with: 2) class = ScaledDecimal.
+ self assert: (1.0s1 perform: op with: 1/2) class = ScaledDecimal.
+ self deny: (1.0s1 perform: op with: 1.0) class = ScaledDecimal.
+
+ self assert: (1 perform: op with: 2.0s1) class = ScaledDecimal.
+ self assert: (1/2 perform: op with: 2.0s1) class = ScaledDecimal.
+ self deny: (1.0 perform: op with: 1.0s1) class = ScaledDecimal]!