Clean up unneeded raw strings in test

This commit is contained in:
David Tolnay 2023-09-26 19:09:30 -07:00
parent 1774794b19
commit 8c4aad3a59
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -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",
);
}
@ -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",
);
}
@ -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",
);
}
@ -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]
@ -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>(
@ -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>(
@ -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...",
);
}