mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-25 05:47:56 +00:00
Integrate bytes test into struct_ test
`newtype` test also integrates test with `Bytes` tag, so be like Removed the first assert_tokens because it is the same as the first assert in the merged method
This commit is contained in:
@@ -345,36 +345,8 @@ fn struct_() {
|
||||
Token::StructEnd,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bytes() {
|
||||
let value = AdjacentlyTagged::Struct::<u8> { f: 1 };
|
||||
|
||||
assert_tokens(
|
||||
&value,
|
||||
&[
|
||||
Token::Struct {
|
||||
name: "AdjacentlyTagged",
|
||||
len: 2,
|
||||
},
|
||||
Token::Str("t"),
|
||||
Token::UnitVariant {
|
||||
name: "AdjacentlyTagged",
|
||||
variant: "Struct",
|
||||
},
|
||||
Token::Str("c"),
|
||||
Token::Struct {
|
||||
name: "Struct",
|
||||
len: 1,
|
||||
},
|
||||
Token::Str("f"),
|
||||
Token::U8(1),
|
||||
Token::StructEnd,
|
||||
Token::StructEnd,
|
||||
],
|
||||
);
|
||||
|
||||
// byte-array field keys
|
||||
assert_de_tokens(
|
||||
&value,
|
||||
&[
|
||||
|
||||
Reference in New Issue
Block a user