Skip to content

Commit 6a097ec

Browse files
committed
Add canary test to ensure that we use adequate enum representation
1 parent 84d1c53 commit 6a097ec

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test_suite/tests/test_macros.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,18 @@ fn test_internally_tagged_struct_variant_containing_unit_variant() {
987987
Log { level: Level },
988988
}
989989

990+
// Canary test that ensures that we use adequate enum representation that
991+
// is possible to deserialize regardless of possible buffering in internally
992+
// tagged enum implementation
993+
assert_de_tokens(
994+
&Level::Info,
995+
&[
996+
Token::Enum { name: "Level" },
997+
Token::BorrowedStr("Info"),
998+
Token::Unit,
999+
],
1000+
);
1001+
9901002
assert_de_tokens(
9911003
&Message::Log { level: Level::Info },
9921004
&[

0 commit comments

Comments
 (0)