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

Function TestExpression

tools/celtest/test_runner.go:436–447  ·  view source on GitHub ↗

TestExpression returns a TestRunnerOption which configures a policy file, expression file, or raw expression for testing

(value string)

Source from the content-addressed store, hash-verified

434// TestExpression returns a TestRunnerOption which configures a policy file, expression file, or raw expression
435// for testing
436func TestExpression(value string) TestRunnerOption {
437 return func(tr *TestRunner) (*TestRunner, error) {
438 if value != "" {
439 tr.Expressions = append(tr.Expressions,
440 &compiler.CompiledExpression{Path: value},
441 &compiler.FileExpression{Path: value},
442 &compiler.RawExpression{Value: value},
443 )
444 }
445 return tr, nil
446 }
447}
448
449// TestCompiler returns a TestRunnerOption which configures the test runner with
450// a compiler created using the set of compiler options.

Callers 6

runTestSuiteFunction · 0.92
TestCoverageStatsFunction · 0.85
TestTriggerTestsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected