From 9d6482204da588a10cc765577f26039f12d84ee6 Mon Sep 17 00:00:00 2001 From: kageru Date: Fri, 15 May 2020 20:28:50 +0200 Subject: [PATCH] Fix test --- src/mask.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mask.rs b/src/mask.rs index 3c326b4..2b8f2a0 100644 --- a/src/mask.rs +++ b/src/mask.rs @@ -193,13 +193,13 @@ mod tests { .iter() .zip(EXPECTED_MASK_02.iter()) .for_each(|(&x, &exp)| { - assert!(get_mask_value(x, 0.2, 10.0) - exp < 0.0001); + assert!((get_mask_value(x, 0.2, 10.0) - exp).abs() < 0.0001); }); FLOAT_RANGE .iter() .zip(EXPECTED_MASK_08.iter()) .for_each(|(&x, &exp)| { - assert!(get_mask_value(x, 0.8, 10.0) - exp < 0.0001); + assert!((get_mask_value(x, 0.8, 10.0) - exp).abs() < 0.0001); }); } }