MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / TestInvalidBytes

Function TestInvalidBytes

internal/strings_test.cc:168–174  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

166// <expected_error_substr>. The last arguments are optional because most
167// flat-out bad inputs are rejected without further information.
168void 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
176TEST(StringsTest, TestParsingOfAllEscapeCharacters) {
177 // All the valid escapes.

Callers 1

TESTFunction · 0.85

Calls 2

ParseBytesLiteralFunction · 0.85
messageMethod · 0.80

Tested by

no test coverage detected