Module abs_diff

Source
Expand description

Contains assertions for values whose distance to each other can be measured, to check whether values are close. Such types are grouped by the AbsDiff trait. See AbsDiffPartialOrdAssertions for more details.

Traits§

AbsDiff
A trait for all types supporting the computation of an absolute difference between two instances, i.e. the “distance” between the two values. This is implemented on all primitive number types of the standard library. Used to allow assertions defined by AbsDiffPartialOrdAssertions.
AbsDiffPartialOrdAssertions
An extension trait to be used on the output of assert_that with arguments that support the computation of absolute differences (by the AbsDiff trait) and implement the PartialOrd trait.