Add canary test to ensure that we use adequate enum representation

This commit is contained in:
Mingun 2023-08-07 20:33:12 +05:00
parent 84d1c5385d
commit 6a097eca93

View File

@ -987,6 +987,18 @@ fn test_internally_tagged_struct_variant_containing_unit_variant() {
Log { level: Level },
}
// Canary test that ensures that we use adequate enum representation that
// is possible to deserialize regardless of possible buffering in internally
// tagged enum implementation
assert_de_tokens(
&Level::Info,
&[
Token::Enum { name: "Level" },
Token::BorrowedStr("Info"),
Token::Unit,
],
);
assert_de_tokens(
&Message::Log { level: Level::Info },
&[