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

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Mon Oct 27 21:13:44 UTC 2014


Once upon a Time, there could have been a literal nan...
Yes, in Squeak 3.8 or 3.9 when formed thru ('0.' , (String new: 320
withAll: $0) , '1e321') - see http://bugs.squeak.org/view.php?id=6982
Let's consider this case rare and accidental...
Now, even if literalEqualityOfNan is a bit like unreachable, let's consider
this as a future proof test...


2014-10-27 21:53 GMT+01:00 <commits at source.squeak.org>:

> Nicolas Cellier uploaded a new version of KernelTests to project The Trunk:
> http://source.squeak.org/trunk/KernelTests-nice.280.mcz
>
> ==================== Summary ====================
>
> Name: KernelTests-nice.280
> Author: nice
> Time: 27 October 2014, 9:53:44.861 pm
> UUID: fc50e9f5-10d8-45d8-8c9e-e80806596878
> Ancestors: KernelTests-dtl.279
>
> Two more expectations for float literal equality:
> - zero and negativeZero are equal but not #literalEqual:
> - nan are not equals but can be #literalEqual:
>
> Thanks to Kris Gybels for reporting this case at
> https://pharo.fogbugz.com/f/cases/14316/
>
> =============== Diff against KernelTests-dtl.279 ===============
>
> Item was added:
> + ----- Method: FloatTest>>testLiteralEqualityOfNan (in category 'testing
> compare') -----
> + testLiteralEqualityOfNan
> +       | nan |
> +       nan := Float nan.
> +       self assert: (nan literalEqual: nan)
> +               description: 'Float nan is not equal to itself, though it
> is literally equal'.!
>
> Item was added:
> + ----- Method: FloatTest>>testLiteralEqualityOfZeroAndNegativeZero (in
> category 'testing compare') -----
> + testLiteralEqualityOfZeroAndNegativeZero
> +       self assert: -1
> +               equals: (Compiler evaluate: '1>2 ifTrue: [0.0] ifFalse:
> [-0.0]') sign
> +               description: 'Float zero and negativeZero are not
> literally substituable'.!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20141027/74c68bde/attachment.htm


More information about the Squeak-dev mailing list