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

Function TEST_P

env/env_std_extensions_test.cc:40–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38class EnvStdExtensions : public testing::TestWithParam<TestCase> {};
39
40TEST_P(EnvStdExtensions, RegistrationTest) {
41 const TestCase& param = GetParam();
42
43 Env env;
44 RegisterStandardExtensions(env);
45 env.SetDescriptorPool(internal::GetSharedTestingDescriptorPool());
46
47 Config config;
48 ASSERT_THAT(config.AddExtensionConfig(param.extension), IsOk());
49 env.SetConfig(config);
50
51 ASSERT_OK_AND_ASSIGN(std::unique_ptr<Compiler> compiler, env.NewCompiler());
52
53 ASSERT_OK_AND_ASSIGN(auto result, compiler->Compile(param.expr));
54 ASSERT_TRUE(result.IsValid()) << "Expected no issues for expr: " << param.expr
55 << " but got: " << result.FormatError();
56}
57
58INSTANTIATE_TEST_SUITE_P(
59 RegistrationTest, EnvStdExtensions,

Callers

nothing calls this directly

Calls 8

AddExtensionConfigMethod · 0.80
NewCompilerMethod · 0.80
IsValidMethod · 0.80
FormatErrorMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70
SetDescriptorPoolMethod · 0.45
SetConfigMethod · 0.45

Tested by

no test coverage detected