Skip to content

Commit d54986c

Browse files
committed
Fix: Use float_cmp for testing floats
Signed-off-by: Matthias Beyer <[email protected]>
1 parent 336a34e commit d54986c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/env.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ fn test_parse_float() {
191191

192192
// can't use `matches!` because of float value
193193
match config {
194-
TestFloatEnum::Float(TestFloat { float_val }) => assert_eq!(float_val, 42.3),
194+
TestFloatEnum::Float(TestFloat { float_val }) => {
195+
assert!(float_cmp::approx_eq!(f64, float_val, 42.3))
196+
}
195197
}
196198
})
197199
}

0 commit comments

Comments
 (0)