TestTriggerTests tests different scenarios of the TriggerTestsFromCompiler function.
(t *testing.T)
| 183 | |
| 184 | // TestTriggerTests tests different scenarios of the TriggerTestsFromCompiler function. |
| 185 | func 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. |
nothing calls this directly
no test coverage detected