From 59628d171272d8dd2de0508a177b0980cbf38694 Mon Sep 17 00:00:00 2001 From: Mingun Date: Mon, 14 Aug 2023 02:48:56 +0500 Subject: [PATCH] Create only one value for all checks --- .../tests/test_enum_adjacently_tagged.rs | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/test_suite/tests/test_enum_adjacently_tagged.rs b/test_suite/tests/test_enum_adjacently_tagged.rs index d60817cc..4b2db7a2 100644 --- a/test_suite/tests/test_enum_adjacently_tagged.rs +++ b/test_suite/tests/test_enum_adjacently_tagged.rs @@ -122,9 +122,11 @@ fn unit() { #[test] fn newtype() { + let value = AdjacentlyTagged::Newtype::(1); + // newtype with tag first assert_tokens( - &AdjacentlyTagged::Newtype::(1), + &value, &[ Token::Struct { name: "AdjacentlyTagged", @@ -143,7 +145,7 @@ fn newtype() { // newtype with content first assert_de_tokens( - &AdjacentlyTagged::Newtype::(1), + &value, &[ Token::Struct { name: "AdjacentlyTagged", @@ -179,7 +181,7 @@ fn newtype() { // integer field keys assert_de_tokens( - &AdjacentlyTagged::Newtype::(1), + &value, &[ Token::Struct { name: "AdjacentlyTagged", @@ -198,7 +200,7 @@ fn newtype() { // byte-array field keys assert_de_tokens( - &AdjacentlyTagged::Newtype::(1), + &value, &[ Token::Struct { name: "AdjacentlyTagged", @@ -218,9 +220,11 @@ fn newtype() { #[test] fn tuple() { + let value = AdjacentlyTagged::Tuple::(1, 1); + // tuple with tag first assert_tokens( - &AdjacentlyTagged::Tuple::(1, 1), + &value, &[ Token::Struct { name: "AdjacentlyTagged", @@ -242,7 +246,7 @@ fn tuple() { // tuple with content first assert_de_tokens( - &AdjacentlyTagged::Tuple::(1, 1), + &value, &[ Token::Struct { name: "AdjacentlyTagged", @@ -265,9 +269,11 @@ fn tuple() { #[test] fn struct_() { + let value = AdjacentlyTagged::Struct:: { f: 1 }; + // struct with tag first assert_tokens( - &AdjacentlyTagged::Struct:: { f: 1 }, + &value, &[ Token::Struct { name: "AdjacentlyTagged", @@ -292,7 +298,7 @@ fn struct_() { // struct with content first assert_de_tokens( - &AdjacentlyTagged::Struct:: { f: 1 }, + &value, &[ Token::Struct { name: "AdjacentlyTagged",