diff options
Diffstat (limited to 'tests/s2d_test.rs')
-rw-r--r-- | tests/s2d_test.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/s2d_test.rs b/tests/s2d_test.rs index f51c1ed..7b42164 100644 --- a/tests/s2d_test.rs +++ b/tests/s2d_test.rs @@ -20,16 +20,35 @@ #![cfg(not(feature = "small"))] #![allow(dead_code)] +#![allow( + clippy::cast_lossless, + clippy::cast_possible_truncation, + clippy::cast_possible_wrap, + clippy::cast_sign_loss, + clippy::excessive_precision, + clippy::float_cmp, + clippy::manual_range_contains, + clippy::similar_names, + clippy::too_many_lines, + clippy::unreadable_literal, + clippy::unseparated_literal_suffix, + clippy::wildcard_imports +)] #[path = "../src/common.rs"] mod common; +#[cfg(not(feature = "small"))] #[path = "../src/d2s_full_table.rs"] mod d2s_full_table; #[path = "../src/d2s_intrinsics.rs"] mod d2s_intrinsics; +#[cfg(feature = "small")] +#[path = "../src/d2s_small_table.rs"] +mod d2s_small_table; + #[path = "../src/d2s.rs"] mod d2s; @@ -77,6 +96,7 @@ fn test_basic() { assert_eq!(1.0, s2d(b"1e0").unwrap()); assert_eq!(1.0, s2d(b"1E0").unwrap()); assert_eq!(1.0, s2d(b"000001.000000").unwrap()); + assert_eq!(0.2316419, s2d(b"0.2316419").unwrap()); } #[test] @@ -128,3 +148,20 @@ fn test_issue157() { s2d(b"1.2999999999999999E+154").unwrap(), ); } + +#[test] +fn test_issue173() { + // Denormal boundary + assert_eq!( + 2.2250738585072012e-308, + s2d(b"2.2250738585072012e-308").unwrap(), + ); + assert_eq!( + 2.2250738585072013e-308, + s2d(b"2.2250738585072013e-308").unwrap(), + ); + assert_eq!( + 2.2250738585072014e-308, + s2d(b"2.2250738585072014e-308").unwrap(), + ); +} |