[−][src]Macro gramit::assert_within_threshold
Assert that two expressions are within a threshold specified by the third parameter, according
to their ApproxEq
implementations.
Passes additional parameters on to the standard library assert!
macro, so custom format
messages are accepted as per usual.
Example
use gramit::ApproxEq; assert_within_threshold!(1.0, 1.5, 0.75); assert_within_threshold!(0.0, 0.1, 0.2, "{} and {} were not within distance {} from each other; this shouldn't happen!", 0.0, 0.1, 0.2);
use gramit::ApproxEq; // Panics! assert_within_threshold!(1.0, 2.0, 0.5);