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

Function TestRuleComposerError

policy/compiler_test.go:49–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func TestRuleComposerError(t *testing.T) {
50 env, err := cel.NewEnv()
51 if err != nil {
52 t.Fatalf("NewEnv() failed: %v", err)
53 }
54 _, err = NewRuleComposer(env, ExpressionUnnestHeight(-1))
55 if err == nil || !strings.Contains(err.Error(), "invalid unnest") {
56 t.Errorf("NewRuleComposer() got %v, wanted 'invalid unnest'", err)
57 }
58}
59
60func TestRuleComposerUnnest(t *testing.T) {
61 for _, tst := range composerUnnestTests {

Callers

nothing calls this directly

Calls 5

NewEnvFunction · 0.92
NewRuleComposerFunction · 0.85
ExpressionUnnestHeightFunction · 0.85
ContainsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected