mirror of
https://github.com/serde-rs/serde.git
synced 2025-10-01 15:01:49 +00:00
Move test for untagged-variant-from-unit where it belongs
This commit is contained in:
parent
c796daed7c
commit
59b99d2d60
@ -137,12 +137,6 @@ enum EnumOther {
|
|||||||
Other,
|
Other,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, Deserialize)]
|
|
||||||
#[serde(untagged)]
|
|
||||||
enum EnumUntaggedUnit {
|
|
||||||
Unit,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Debug)]
|
||||||
struct IgnoredAny;
|
struct IgnoredAny;
|
||||||
|
|
||||||
@ -794,9 +788,6 @@ declare_tests! {
|
|||||||
Token::Unit,
|
Token::Unit,
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
test_enum_untagged_unit_from_none {
|
|
||||||
EnumUntaggedUnit::Unit => &[Token::None],
|
|
||||||
}
|
|
||||||
test_box {
|
test_box {
|
||||||
Box::new(0i32) => &[Token::I32(0)],
|
Box::new(0i32) => &[Token::I32(0)],
|
||||||
}
|
}
|
||||||
|
@ -638,6 +638,7 @@ fn test_untagged_enum() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
assert_tokens(&Untagged::C, &[Token::Unit]);
|
assert_tokens(&Untagged::C, &[Token::Unit]);
|
||||||
|
assert_tokens(&Untagged::C, &[Token::None]);
|
||||||
|
|
||||||
assert_tokens(&Untagged::D(4), &[Token::U8(4)]);
|
assert_tokens(&Untagged::D(4), &[Token::U8(4)]);
|
||||||
assert_tokens(&Untagged::E("e".to_owned()), &[Token::Str("e")]);
|
assert_tokens(&Untagged::E("e".to_owned()), &[Token::Str("e")]);
|
||||||
@ -652,11 +653,6 @@ fn test_untagged_enum() {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_de_tokens_error::<Untagged>(
|
|
||||||
&[Token::None],
|
|
||||||
"data did not match any variant of untagged enum Untagged",
|
|
||||||
);
|
|
||||||
|
|
||||||
assert_de_tokens_error::<Untagged>(
|
assert_de_tokens_error::<Untagged>(
|
||||||
&[Token::Tuple { len: 1 }, Token::U8(1), Token::TupleEnd],
|
&[Token::Tuple { len: 1 }, Token::U8(1), Token::TupleEnd],
|
||||||
"data did not match any variant of untagged enum Untagged",
|
"data did not match any variant of untagged enum Untagged",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user