Test integer128 impls

This commit is contained in:
David Tolnay 2018-05-19 16:31:44 -07:00
parent c17bc6c49c
commit 9083cf4b00
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 28 additions and 0 deletions

View File

@ -259,6 +259,27 @@ declare_tests! {
0f32 => &[Token::F32(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 {
'a' => &[Token::Char('a')],
'a' => &[Token::Str("a")],

View File

@ -586,3 +586,10 @@ fn test_enum_skipped() {
"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");
}