Skip to content

Commit

Permalink
Clean up unneeded raw strings in test
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 27, 2023
1 parent 1774794 commit 8c4aad3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test_suite/tests/test_annotations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2719,7 +2719,7 @@ fn test_expecting_message_externally_tagged_enum() {
// Check that #[serde(expecting = "...")] doesn't affect variant identifier error message
assert_de_tokens_error::<Enum>(
&[Token::Enum { name: "Enum" }, Token::Unit],
r"invalid type: unit value, expected variant identifier",
"invalid type: unit value, expected variant identifier",
);
}

Expand All @@ -2740,7 +2740,7 @@ fn test_expecting_message_internally_tagged_enum() {
// Check that #[serde(expecting = "...")] doesn't affect variant identifier error message
assert_de_tokens_error::<Enum>(
&[Token::Map { len: None }, Token::Str("tag"), Token::Unit],
r"invalid type: unit value, expected variant identifier",
"invalid type: unit value, expected variant identifier",
);
}

Expand All @@ -2766,7 +2766,7 @@ fn test_expecting_message_adjacently_tagged_enum() {
// Check that #[serde(expecting = "...")] doesn't affect variant identifier error message
assert_de_tokens_error::<Enum>(
&[Token::Map { len: None }, Token::Str("tag"), Token::Unit],
r"invalid type: unit value, expected variant of enum Enum",
"invalid type: unit value, expected variant of enum Enum",
);
}

Expand All @@ -2779,7 +2779,7 @@ fn test_expecting_message_untagged_tagged_enum() {
Untagged,
}

assert_de_tokens_error::<Enum>(&[Token::Str("Untagged")], r"something strange...");
assert_de_tokens_error::<Enum>(&[Token::Str("Untagged")], "something strange...");
}

#[test]
Expand All @@ -2800,7 +2800,7 @@ fn test_expecting_message_identifier_enum() {

assert_de_tokens_error::<FieldEnum>(
&[Token::Unit],
r"invalid type: unit value, expected something strange...",
"invalid type: unit value, expected something strange...",
);

assert_de_tokens_error::<FieldEnum>(
Expand All @@ -2809,12 +2809,12 @@ fn test_expecting_message_identifier_enum() {
Token::Str("Unknown"),
Token::None,
],
r"invalid type: map, expected something strange...",
"invalid type: map, expected something strange...",
);

assert_de_tokens_error::<VariantEnum>(
&[Token::Unit],
r"invalid type: unit value, expected something strange...",
"invalid type: unit value, expected something strange...",
);

assert_de_tokens_error::<VariantEnum>(
Expand All @@ -2825,7 +2825,7 @@ fn test_expecting_message_identifier_enum() {
Token::Str("Unknown"),
Token::None,
],
r"invalid type: map, expected something strange...",
"invalid type: map, expected something strange...",
);
}

Expand Down

0 comments on commit 8c4aad3

Please sign in to comment.