From bee74707154049eb823732043c0e422b7b04a742 Mon Sep 17 00:00:00 2001 From: Mingun Date: Mon, 14 Aug 2023 02:19:31 +0500 Subject: [PATCH] Split test test_adjacently_tagged_enum into four tests for each variant (review this commit with "ignore whitespace changes" option on) --- .../tests/test_enum_adjacently_tagged.rs | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/test_suite/tests/test_enum_adjacently_tagged.rs b/test_suite/tests/test_enum_adjacently_tagged.rs index a7968336..d60817cc 100644 --- a/test_suite/tests/test_enum_adjacently_tagged.rs +++ b/test_suite/tests/test_enum_adjacently_tagged.rs @@ -11,17 +11,17 @@ use serde_test::{ assert_de_tokens, assert_de_tokens_error, assert_ser_tokens, assert_tokens, Token, }; -#[test] -fn test_adjacently_tagged_enum() { - #[derive(Debug, PartialEq, Serialize, Deserialize)] - #[serde(tag = "t", content = "c")] - enum AdjacentlyTagged { - Unit, - Newtype(T), - Tuple(u8, u8), - Struct { f: u8 }, - } +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[serde(tag = "t", content = "c")] +enum AdjacentlyTagged { + Unit, + Newtype(T), + Tuple(u8, u8), + Struct { f: u8 }, +} +#[test] +fn unit() { // unit with no content assert_ser_tokens( &AdjacentlyTagged::Unit::, @@ -118,7 +118,10 @@ fn test_adjacently_tagged_enum() { Token::StructEnd, ], ); +} +#[test] +fn newtype() { // newtype with tag first assert_tokens( &AdjacentlyTagged::Newtype::(1), @@ -211,7 +214,10 @@ fn test_adjacently_tagged_enum() { Token::StructEnd, ], ); +} +#[test] +fn tuple() { // tuple with tag first assert_tokens( &AdjacentlyTagged::Tuple::(1, 1), @@ -255,7 +261,10 @@ fn test_adjacently_tagged_enum() { Token::StructEnd, ], ); +} +#[test] +fn struct_() { // struct with tag first assert_tokens( &AdjacentlyTagged::Struct:: { f: 1 },