diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2022-08-02 09:12:15 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2022-08-02 09:12:15 +0200 |
commit | d54986c54091e4620c199d3dfadde80b82958bb3 (patch) | |
tree | 14d7eeecd0994ae51848fb4a446adde012b3207d | |
parent | 336a34e52c8b0889180c865b29c89420cd1788dc (diff) |
Fix: Use float_cmp for testing floats
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | tests/env.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/env.rs b/tests/env.rs index 2ee67de..3a24bde 100644 --- a/tests/env.rs +++ b/tests/env.rs @@ -191,7 +191,9 @@ fn test_parse_float() { // can't use `matches!` because of float value match config { - TestFloatEnum::Float(TestFloat { float_val }) => assert_eq!(float_val, 42.3), + TestFloatEnum::Float(TestFloat { float_val }) => { + assert!(float_cmp::approx_eq!(f64, float_val, 42.3)) + } } }) } |