diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2022-08-02 09:12:15 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2022-08-02 16:55:05 +0200 |
commit | 475f689de98f5353b7e108716e7d764673e14c1b (patch) | |
tree | d4f36976c9f11e6c9b55880de31475edbe42ac10 | |
parent | a282a97c07b2f266e8862f0d19fd6bc742391c91 (diff) |
Fix: Use float_cmp for testing floats
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
(cherry picked from commit d54986c54091e4620c199d3dfadde80b82958bb3)
-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)) + } } }) } |