JUnit has the equivalent of: assert:equals:range:
It could then be:
self assert: 11.11 equals: 11.11 range: 0.0001
Alexandre
> On Sep 2, 2016, at 7:21 PM, Yuriy Tymchuk wrote:
>
> how about having assert:closeTo: ?
>
>> On 02 Sep 2016, at 21:09, Henrik Nergaard wrote:
>>
>> You could imple
Thanks I will try that.
Stef
Le 2/9/16 à 21:09, Henrik Nergaard a écrit :
You could implement a custom assert in ConverterTest to do the comparison,
something like
assert: aNumber withPrecision: precision equals: otherNumber
self
assert: (aNumber round: precision)
e
would be nice to extend Sunit with that
Le 3/9/16 à 00:21, Yuriy Tymchuk a écrit :
how about having assert:closeTo: ?
On 02 Sep 2016, at 21:09, Henrik Nergaard wrote:
You could implement a custom assert in ConverterTest to do the comparison,
something like
assert: aNumber withPrecision:
how about having assert:closeTo: ?
> On 02 Sep 2016, at 21:09, Henrik Nergaard wrote:
>
> You could implement a custom assert in ConverterTest to do the comparison,
> something like
>
> assert: aNumber withPrecision: precision equals: otherNumber
>
> self
> assert: (aNumber roun
You could implement a custom assert in ConverterTest to do the comparison,
something like
assert: aNumber withPrecision: precision equals: otherNumber
self
assert: (aNumber round: precision)
equals: otherNumber
assert: aNumber closeTo: otherNumber
assert: aNu
Why not use "equalsTo:"?
Floats are tricky, you either round your result before comparing or
change the comparison method.
0.33 equalsTo: (1/3) "true"
Regards!
Esteban A. Maringolo
2016-09-02 15:41 GMT-03:00 stepharo :
> Hi
>
> I'm writing a simple converter between Celcius and