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

Function TEST

codelab/exercise4_test.cc:28–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26using ::google::rpc::context::AttributeContext;
27
28TEST(EvaluateWithExtensionFunction, Baseline) {
29 AttributeContext context;
30 ASSERT_TRUE(google::protobuf::TextFormat::ParseFromString(
31 R"(request {
32 path: "/"
33 auth {
34 claims {
35 fields {
36 key: "group"
37 value {string_value: "admin"}
38 }
39 }
40 }
41 })",
42 &context));
43 EXPECT_THAT(EvaluateWithExtensionFunction("request.path == '/'", context),
44 IsOkAndHolds(true));
45}
46
47TEST(EvaluateWithExtensionFunction, ContainsTrue) {
48 AttributeContext context;

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected