Macro deltae::assert_delta_ne
source · macro_rules! assert_delta_ne { ($reference:expr, $sample:expr, $method:expr, $tolerance:expr) => { ... }; ($reference:expr, $sample:expr, $method:expr, $tolerance:expr, $($message:tt)*) => { ... }; }
Expand description
Convenience macro for asserting two values are equivalent within a tolerance
use deltae::*;
let lab0 = LabValue::new(50.0, 0.0, 0.0).unwrap();
let lab1 = LabValue::new(50.1, 1.0, 1.0).unwrap();
// Assert that the difference between lab0 and lab1 is greater than 1.0 DE2000
assert_delta_ne!(lab0, lab1, DE2000, 1.0);