mirror of
https://github.com/serde-rs/json.git
synced 2025-10-02 07:21:29 +00:00
Modify test
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
parent
f69e1ffe3f
commit
f3c641c228
@ -1913,22 +1913,7 @@ fn test_partialeq_number() {
|
||||
#[cfg(integer128)]
|
||||
#[cfg(feature = "arbitrary_precision")]
|
||||
fn test_partialeq_integer128() {
|
||||
use std::{u128, i128};
|
||||
use std::str::FromStr;
|
||||
fn test_u128_number_partial_eq(input: u128) {
|
||||
let val1 = serde_json::Value::from_str(&format!("{}", input)).unwrap();
|
||||
let val2 = serde_json::to_value(input).unwrap();
|
||||
assert_eq!(val1, val2);
|
||||
}
|
||||
fn test_i128_number_partial_eq(input: i128) {
|
||||
let val1 = serde_json::Value::from_str(&format!("{}", input)).unwrap();
|
||||
let val2 = serde_json::to_value(input).unwrap();
|
||||
assert_eq!(val1, val2);
|
||||
}
|
||||
test_u128_number_partial_eq(u128::MAX);
|
||||
test_u128_number_partial_eq(u128::MIN);
|
||||
test_i128_number_partial_eq(i128::MAX);
|
||||
test_i128_number_partial_eq(i128::MIN);
|
||||
number_partialeq_ok!(i128::MIN i128::MAX u128::MIN u128::MAX)
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
x
Reference in New Issue
Block a user