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

Function TestInvalidString

internal/strings_test.cc:156–162  ·  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

154// <expected_error_substr>. The last arguments are optional because most
155// flat-out bad inputs are rejected without further information.
156void TestInvalidString(const std::string& str,
157 const std::string& expected_error_substr = "") {
158 auto status_or_string = ParseStringLiteral(str);
159 EXPECT_THAT(status_or_string, StatusIs(absl::StatusCode::kInvalidArgument));
160 EXPECT_TRUE(absl::StrContains(status_or_string.status().message(),
161 expected_error_substr));
162}
163
164// Test that <str> is treated as invalid, with error offset
165// <expected_error_offset> and an error that contains substring

Callers 1

TESTFunction · 0.85

Calls 2

ParseStringLiteralFunction · 0.85
messageMethod · 0.80

Tested by

no test coverage detected