From 3257851192da0f6747540f28a5567f5ede8c7434 Mon Sep 17 00:00:00 2001 From: Mingun Date: Tue, 3 Nov 2020 21:37:02 +0500 Subject: [PATCH] Extend test_internally_tagged_struct_variant_containing_unit_variant to cover maps and seqs --- test_suite/tests/test_macros.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test_suite/tests/test_macros.rs b/test_suite/tests/test_macros.rs index c6c0c178..2b0470a5 100644 --- a/test_suite/tests/test_macros.rs +++ b/test_suite/tests/test_macros.rs @@ -994,6 +994,28 @@ fn test_internally_tagged_struct_variant_containing_unit_variant() { Token::StructEnd, ], ); + + assert_de_tokens( + &Message::Log { level: Level::Info }, + &[ + Token::Map { len: Some(2) }, + Token::Str("action"), + Token::Str("Log"), + Token::Str("level"), + Token::BorrowedStr("Info"), + Token::MapEnd, + ], + ); + + assert_de_tokens( + &Message::Log { level: Level::Info }, + &[ + Token::Seq { len: Some(2) }, + Token::Str("Log"), + Token::BorrowedStr("Info"), + Token::SeqEnd, + ], + ); } #[test]