mirror of
https://gitee.com/openharmony/third_party_rust_serde
synced 2024-11-23 06:50:23 +00:00
Extend test_internally_tagged_struct_variant_containing_unit_variant to cover maps and seqs
This commit is contained in:
parent
9a84622c56
commit
3257851192
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user