[BUG][FIX] ScaledDecimal and Number class>>ReadFrom:

David T. Lewis lewis at mail.msen.com
Sun Sep 19 03:28:42 UTC 2004


Reported bug:

  '1.40s2' asNumber ==> 1.39s2

This change set fixes a bug in creation of ScaledDecimals from
strings and literals. It cleans up and refactors Number class>>readFrom:
for creating ScaledDecimals, Floats, and Integers. It attempts to
avoid suble compiler bugs by ensuring that the stream from which
#readFrom: is reading is kept in a valid state if parsing fails
after a decimal point (a period intended for the Smalltalk parser).

Load the unit tests first to demonstrate the bugs.

Prior to applying NumberReadFromFixes, IntegerTest should show
two failing tests, FloatTest should show zero failing tests, and
ScaleDecimalTest should show four failing tests.

Then load the NumberReadFromFixes. Rerun the unit tests. IntegerTest,
FloatTest, and ScaledDecimalTest should all pass.

Note: ScaledDecimalTest>>testLiteral must be recompiled after
the fix is loaded, otherwise the test will fail. The postscript
to the NumberReadFromFixes change set should do this. If the test
still fails, load the NumberReadFromTests change set to force a
recompile.

Dave

-------------- next part --------------
A non-text attachment was scrubbed...
Name: NumberReadFromTests-dtl.cs.gz
Type: application/x-gunzip
Size: 1707 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040918/efb19dcf/NumberReadFromTests-dtl.cs.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NumberReadFromFixes-dtl.cs.gz
Type: application/x-gunzip
Size: 1950 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040918/efb19dcf/NumberReadFromFixes-dtl.cs.bin


More information about the Squeak-dev mailing list