Skip to content

Commit

Permalink
Test integer128 impls
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed May 21, 2018
1 parent c17bc6c commit 9083cf4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test_suite/tests/test_de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")],
Expand Down
7 changes: 7 additions & 0 deletions test_suite/tests/test_ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

0 comments on commit 9083cf4

Please sign in to comment.