expect_near, then returns from the calling procedure on a failure.
- got: the value under test.
- want: the value it should be close to.
- tolerance: the largest allowed difference.
- loc: where the check is written, shown when it fails. Leave the default.
require_near :: (
got: float64,
want: float64,
tolerance: float64,
loc := #caller_location
)
expect_near, then returns from the calling procedure on a failure.
Parameters
- got: float64
- the value under test.
- want: float64
- the value it should be close to.
- tolerance: float64
- the largest allowed difference.
- loc := #caller_location
- where the check is written, shown when it fails. Leave the default.