Move test for untagged-variant-from-unit where it belongs

This commit is contained in:
Árpád Goretity 2019-11-07 21:18:12 +01:00
parent c796daed7c
commit 59b99d2d60
2 changed files with 1 additions and 14 deletions

View File

@ -137,12 +137,6 @@ enum EnumOther {
Other,
}
#[derive(PartialEq, Debug, Deserialize)]
#[serde(untagged)]
enum EnumUntaggedUnit {
Unit,
}
#[derive(PartialEq, Debug)]
struct IgnoredAny;
@ -794,9 +788,6 @@ declare_tests! {
Token::Unit,
],
}
test_enum_untagged_unit_from_none {
EnumUntaggedUnit::Unit => &[Token::None],
}
test_box {
Box::new(0i32) => &[Token::I32(0)],
}

View File

@ -638,6 +638,7 @@ fn test_untagged_enum() {
);
assert_tokens(&Untagged::C, &[Token::Unit]);
assert_tokens(&Untagged::C, &[Token::None]);
assert_tokens(&Untagged::D(4), &[Token::U8(4)]);
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>(
&[Token::Tuple { len: 1 }, Token::U8(1), Token::TupleEnd],
"data did not match any variant of untagged enum Untagged",