MCPcopy Create free account
hub / github.com/cel-expr/cel-go / TestTriggerTests

Function TestTriggerTests

tools/celtest/test_runner_test.go:185–209  ·  view source on GitHub ↗

TestTriggerTests tests different scenarios of the TriggerTestsFromCompiler function.

(t *testing.T)

Source from the content-addressed store, hash-verified

183
184// TestTriggerTests tests different scenarios of the TriggerTestsFromCompiler function.
185func TestTriggerTests(t *testing.T) {
186 for _, tc := range setupTests() {
187 t.Run(tc.name, func(t *testing.T) {
188 var testOpts []TestRunnerOption
189 compileOpts := make([]any, 0, len(tc.opts)+2)
190 for _, opt := range tc.opts {
191 compileOpts = append(compileOpts, opt)
192 }
193 if tc.fileDescriptorSetPath != "" {
194 compileOpts = append(compileOpts, compiler.TypeDescriptorSetFile(tc.fileDescriptorSetPath))
195 }
196 if tc.configPath != "" {
197 compileOpts = append(compileOpts, compiler.EnvironmentFile(tc.configPath))
198 }
199 testOpts = append(testOpts,
200 TestCompiler(compileOpts...),
201 FileDescriptorSet(tc.fileDescriptorSetPath),
202 TestSuite(tc.testSuitePath),
203 TestExpression(tc.celExpression),
204 PartialEvalProgramOption(),
205 )
206 TriggerTests(t, testOpts...)
207 })
208 }
209}
210
211// TestCustomTestSuiteParser triggers the test runner where the tests are provided by a custom
212// test suite parser configured using TestSuiteParserOption.

Callers

nothing calls this directly

Calls 9

TypeDescriptorSetFileFunction · 0.92
EnvironmentFileFunction · 0.92
setupTestsFunction · 0.85
TestCompilerFunction · 0.85
FileDescriptorSetFunction · 0.85
TestExpressionFunction · 0.85
PartialEvalProgramOptionFunction · 0.85
TriggerTestsFunction · 0.85
TestSuiteFunction · 0.70

Tested by

no test coverage detected