2016-09-03 9:22 GMT+02:00 stepharo <stepharo@free.fr>:
Denis
can we also have
assert: aNumber withPrecision: precision equals: otherNumber
self assert: (aNumber round: precision) equals: otherNumber
assert: aNumber closeTo: otherNumber
assert: aNumber withPrecision: self defaultPrecision equals: otherNumber
defaultPrecision ^ 2
We could add it but as different issue. Also I really want move away from assertions to should expressions. It is much nicer to write things like this (which available in StateSpecs): 10.1234 should equal: 10.12 within: 0.01 "success" 10.1234 should equal: 10.12 within: 0.001 "failure" Also I has idea that float assertions should always use default precision (like 0.00000000001) without special message. (80.85 * 100) should equal: 8085 It will fail now but I want it always succeed in such cases. Because in most cases users don't care about this. And when it has real value users will specify concrete precision