mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-13 20:41:02 +00:00
Test integer128 impls
This commit is contained in:
@@ -259,6 +259,27 @@ declare_tests! {
|
|||||||
0f32 => &[Token::F32(0.)],
|
0f32 => &[Token::F32(0.)],
|
||||||
0f64 => &[Token::F64(0.)],
|
0f64 => &[Token::F64(0.)],
|
||||||
}
|
}
|
||||||
|
test_small_int_to_128 {
|
||||||
|
1i128 => &[Token::I8(1)],
|
||||||
|
1i128 => &[Token::I16(1)],
|
||||||
|
1i128 => &[Token::I32(1)],
|
||||||
|
1i128 => &[Token::I64(1)],
|
||||||
|
|
||||||
|
1i128 => &[Token::U8(1)],
|
||||||
|
1i128 => &[Token::U16(1)],
|
||||||
|
1i128 => &[Token::U32(1)],
|
||||||
|
1i128 => &[Token::U64(1)],
|
||||||
|
|
||||||
|
1u128 => &[Token::I8(1)],
|
||||||
|
1u128 => &[Token::I16(1)],
|
||||||
|
1u128 => &[Token::I32(1)],
|
||||||
|
1u128 => &[Token::I64(1)],
|
||||||
|
|
||||||
|
1u128 => &[Token::U8(1)],
|
||||||
|
1u128 => &[Token::U16(1)],
|
||||||
|
1u128 => &[Token::U32(1)],
|
||||||
|
1u128 => &[Token::U64(1)],
|
||||||
|
}
|
||||||
test_char {
|
test_char {
|
||||||
'a' => &[Token::Char('a')],
|
'a' => &[Token::Char('a')],
|
||||||
'a' => &[Token::Str("a")],
|
'a' => &[Token::Str("a")],
|
||||||
|
|||||||
@@ -586,3 +586,10 @@ fn test_enum_skipped() {
|
|||||||
"the enum variant Enum::SkippedMap cannot be serialized",
|
"the enum variant Enum::SkippedMap cannot be serialized",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_integer128() {
|
||||||
|
assert_ser_tokens_error(&1i128, &[], "i128 is not supported");
|
||||||
|
|
||||||
|
assert_ser_tokens_error(&1u128, &[], "u128 is not supported");
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user