--- a/RegressionTests__ScaledDecimalTest.st Fri Feb 17 15:47:31 2006 +0100
+++ b/RegressionTests__ScaledDecimalTest.st Fri Feb 17 15:56:53 2006 +0100
@@ -201,6 +201,36 @@
].
!
+testPrintString
+ "The printed representation of a ScaledDecimal is truncated, not rounded.
+ Not sure if this is right, so this test describes the current Squeak implementation.
+ If someone knows a reason that rounding would be preferable, then update
+ this test."
+
+ | sd |
+
+ sd := (13 / 11) asScaledDecimal: 6.
+ Smalltalk isSmalltalkX ifTrue:[
+ self assert: ('1.181818' = sd printString).
+ ] ifFalse:[
+ self assert: ('1.181818s6' = sd printString).
+ ].
+
+ sd := (13 / 11) asScaledDecimal: 5.
+ Smalltalk isSmalltalkX ifTrue:[
+ self assert: ('1.18182' = sd printString).
+ ] ifFalse:[
+ self deny: ('1.18182s5' = sd printString).
+ ].
+
+ sd := (13 / 11) asScaledDecimal: 5.
+ Smalltalk isSmalltalkX ifTrue:[
+ self deny: ('1.18181' = sd printString).
+ ] ifFalse:[
+ self assert: ('1.18181s5' = sd printString).
+ ].
+!
+
testStoreAndRead
|check|