fun Assert<Float>.toBeWithErrorTolerance(expected: Float, tolerance: Float): AssertionPlant<Float>
(source)fun Assert<Double>.toBeWithErrorTolerance(expected: Double, tolerance: Double): AssertionPlant<Double>
(source)fun Assert<BigDecimal>.toBeWithErrorTolerance(expected: BigDecimal, tolerance: BigDecimal): AssertionPlant<BigDecimal>
(source)Makes the assertion that the Assert.subject is equal to expected with an error tolerance (range including bounds).
It effectively compares the absolute difference between Assert.subject and expected and compares it with the tolerance. As long as it is less than or equal the tolerance the assertion holds; otherwise it fails. A more mathematical way of expressing the assertion is the following inequality:
| Assert.subject - expected | ≤ tolerance
AssertionError
- Might throw an AssertionError if the assertion made is not correct.
Return
This plant to support a fluent API.