Test that is treated as invalid, with error offset and an error that contains substring . The last arguments are optional because most flat-out bad inputs are rejected without further information.
| 166 | // <expected_error_substr>. The last arguments are optional because most |
| 167 | // flat-out bad inputs are rejected without further information. |
| 168 | void TestInvalidBytes(const std::string& str, |
| 169 | const std::string& expected_error_substr = "") { |
| 170 | auto status_or_string = ParseBytesLiteral(str); |
| 171 | EXPECT_THAT(status_or_string, StatusIs(absl::StatusCode::kInvalidArgument)); |
| 172 | EXPECT_TRUE(absl::StrContains(status_or_string.status().message(), |
| 173 | expected_error_substr)); |
| 174 | } |
| 175 | |
| 176 | TEST(StringsTest, TestParsingOfAllEscapeCharacters) { |
| 177 | // All the valid escapes. |
no test coverage detected