diff options
Diffstat (limited to 'third_party/rust/serde_json/tests/lexical')
-rw-r--r-- | third_party/rust/serde_json/tests/lexical/exponent.rs | 34 | ||||
-rw-r--r-- | third_party/rust/serde_json/tests/lexical/parse.rs | 2 |
2 files changed, 9 insertions, 27 deletions
diff --git a/third_party/rust/serde_json/tests/lexical/exponent.rs b/third_party/rust/serde_json/tests/lexical/exponent.rs index f7a847be38..c109ff07df 100644 --- a/third_party/rust/serde_json/tests/lexical/exponent.rs +++ b/third_party/rust/serde_json/tests/lexical/exponent.rs @@ -17,38 +17,20 @@ fn scientific_exponent_test() { assert_eq!(scientific_exponent(-10, 2, 20), -9); // Underflow - assert_eq!( - scientific_exponent(i32::min_value(), 0, 0), - i32::min_value() - ); - assert_eq!( - scientific_exponent(i32::min_value(), 0, 5), - i32::min_value() - ); + assert_eq!(scientific_exponent(i32::MIN, 0, 0), i32::MIN); + assert_eq!(scientific_exponent(i32::MIN, 0, 5), i32::MIN); // Overflow - assert_eq!( - scientific_exponent(i32::max_value(), 0, 0), - i32::max_value() - 1 - ); - assert_eq!( - scientific_exponent(i32::max_value(), 5, 0), - i32::max_value() - ); + assert_eq!(scientific_exponent(i32::MAX, 0, 0), i32::MAX - 1); + assert_eq!(scientific_exponent(i32::MAX, 5, 0), i32::MAX); } #[test] fn mantissa_exponent_test() { assert_eq!(mantissa_exponent(10, 5, 0), 5); assert_eq!(mantissa_exponent(0, 5, 0), -5); - assert_eq!( - mantissa_exponent(i32::max_value(), 5, 0), - i32::max_value() - 5 - ); - assert_eq!(mantissa_exponent(i32::max_value(), 0, 5), i32::max_value()); - assert_eq!(mantissa_exponent(i32::min_value(), 5, 0), i32::min_value()); - assert_eq!( - mantissa_exponent(i32::min_value(), 0, 5), - i32::min_value() + 5 - ); + assert_eq!(mantissa_exponent(i32::MAX, 5, 0), i32::MAX - 5); + assert_eq!(mantissa_exponent(i32::MAX, 0, 5), i32::MAX); + assert_eq!(mantissa_exponent(i32::MIN, 5, 0), i32::MIN); + assert_eq!(mantissa_exponent(i32::MIN, 0, 5), i32::MIN + 5); } diff --git a/third_party/rust/serde_json/tests/lexical/parse.rs b/third_party/rust/serde_json/tests/lexical/parse.rs index 80ca25e772..03ec1a9a63 100644 --- a/third_party/rust/serde_json/tests/lexical/parse.rs +++ b/third_party/rust/serde_json/tests/lexical/parse.rs @@ -1,7 +1,7 @@ // Adapted from https://github.com/Alexhuszagh/rust-lexical. use crate::lexical::num::Float; -use crate::lexical::parse::{parse_concise_float, parse_truncated_float}; +use crate::lexical::{parse_concise_float, parse_truncated_float}; use core::f64; use core::fmt::Debug; |