From 99fe9e865b23d684b33bffea20cd9001c6868539 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 13 Feb 2022 18:07:19 +0100 Subject: [PATCH] Fix decimals in snapping test --- src/param/range.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/param/range.rs b/src/param/range.rs index 97051942..b0127ea8 100644 --- a/src/param/range.rs +++ b/src/param/range.rs @@ -252,7 +252,8 @@ mod tests { fn step_size() { // These are weird step sizes, but if it works here then it will work for anything let range = make_linear_float_range(); - assert_eq!(range.snap_to_step(13.0, 4.73), 14.49); + // XXX: We round to decimal places when outputting, but not when snapping to steps + assert_eq!(range.snap_to_step(13.0, 4.73), 14.190001); } #[test]