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

Function TEST

compiler/optional_test.cc:263–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261 }));
262
263TEST(OptionalTest, NotEnabled) {
264 ASSERT_OK_AND_ASSIGN(
265 auto builder,
266 NewCompilerBuilder(cel::internal::GetSharedTestingDescriptorPool()));
267 ASSERT_THAT(builder->AddLibrary(StandardCheckerLibrary()), IsOk());
268 ASSERT_THAT(builder->GetCheckerBuilder().AddVariable(MakeVariableDecl(
269 "msg", MessageType(TestAllTypes::descriptor()))),
270 IsOk());
271
272 ASSERT_OK_AND_ASSIGN(auto compiler, std::move(*builder).Build());
273
274 ASSERT_OK_AND_ASSIGN(auto result, compiler->Compile("optional.of(1)"));
275
276 EXPECT_THAT(FormatIssues(result),
277 HasSubstr("undeclared reference to 'optional'"));
278}
279
280struct OptionalExtensionVersionTestCase {
281 std::string expr;

Callers

nothing calls this directly

Calls 6

StandardCheckerLibraryFunction · 0.85
MakeVariableDeclFunction · 0.85
AddVariableMethod · 0.80
FormatIssuesFunction · 0.70
MessageTypeClass · 0.50
AddLibraryMethod · 0.45

Tested by

no test coverage detected