offsetMoreOrLessEquals function
Asserts that two Offsets are equal, within some tolerated error.
Two values are considered equal if the difference between them is within
precisionErrorTolerance of the larger one. This is an arbitrary value
which can be adjusted using the epsilon
argument. This matcher is intended
to compare floating point numbers that are the result of different sequences
of operations, such that they may have accumulated slightly different
errors.
See also:
- moreOrLessEquals, which is for doubles.
- rectMoreOrLessEquals, which is for Rects.
- within, which offers a generic version of this functionality that can be used to match Offsets as well as other types.
Implementation
Matcher offsetMoreOrLessEquals(Offset value, { double epsilon = precisionErrorTolerance }) {
return _IsWithinDistance<Offset>(_offsetDistance, value, epsilon);
}