Testing module

require_near

procedure · 1 overloadsince 0.28.0Source

expect_near, then returns from the calling procedure on a failure.

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.

See also