mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-29 22:17:55 +00:00
No need to test integer and byte array field names, they already tested for Unit case
There is no difference what variant is deserialized so we can test only one kind of variant
This commit is contained in:
@@ -360,44 +360,6 @@ fn newtype() {
|
||||
Token::StructEnd,
|
||||
],
|
||||
);
|
||||
|
||||
// integer field keys
|
||||
assert_de_tokens(
|
||||
&value,
|
||||
&[
|
||||
Token::Struct {
|
||||
name: "AdjacentlyTagged",
|
||||
len: 2,
|
||||
},
|
||||
Token::U64(1), // content field
|
||||
Token::U8(1),
|
||||
Token::U64(0), // tag field
|
||||
Token::UnitVariant {
|
||||
name: "AdjacentlyTagged",
|
||||
variant: "Newtype",
|
||||
},
|
||||
Token::StructEnd,
|
||||
],
|
||||
);
|
||||
|
||||
// byte-array field keys
|
||||
assert_de_tokens(
|
||||
&value,
|
||||
&[
|
||||
Token::Struct {
|
||||
name: "AdjacentlyTagged",
|
||||
len: 2,
|
||||
},
|
||||
Token::Bytes(b"c"),
|
||||
Token::U8(1),
|
||||
Token::Bytes(b"t"),
|
||||
Token::UnitVariant {
|
||||
name: "AdjacentlyTagged",
|
||||
variant: "Newtype",
|
||||
},
|
||||
Token::StructEnd,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -529,31 +491,6 @@ fn struct_() {
|
||||
Token::StructEnd,
|
||||
],
|
||||
);
|
||||
|
||||
// byte-array field keys
|
||||
assert_de_tokens(
|
||||
&value,
|
||||
&[
|
||||
Token::Struct {
|
||||
name: "AdjacentlyTagged",
|
||||
len: 2,
|
||||
},
|
||||
Token::Bytes(b"t"),
|
||||
Token::UnitVariant {
|
||||
name: "AdjacentlyTagged",
|
||||
variant: "Struct",
|
||||
},
|
||||
Token::Bytes(b"c"),
|
||||
Token::Struct {
|
||||
name: "Struct",
|
||||
len: 1,
|
||||
},
|
||||
Token::Str("f"),
|
||||
Token::U8(1),
|
||||
Token::StructEnd,
|
||||
Token::StructEnd,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user