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

Function TestStaticOptimizerNilAST

cel/optimizer_test.go:257–267  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

255}
256
257func TestStaticOptimizerNilAST(t *testing.T) {
258 env := optimizerEnv(t)
259 opt, err := cel.NewStaticOptimizer(&identityOptimizer{t: t})
260 if err != nil {
261 t.Fatalf("NewStaticOptimizer() failed: %v", err)
262 }
263 optAST, iss := opt.Optimize(env, nil)
264 if iss.Err() == nil || !strings.Contains(iss.Err().Error(), "unexpected unspecified type") {
265 t.Errorf("opt.Optimize(env, nil) got (%v, %v), wanted unexpected unspecified type", optAST, iss)
266 }
267}
268
269type identityOptimizer struct {
270 t *testing.T

Callers

nothing calls this directly

Calls 6

OptimizeMethod · 0.95
NewStaticOptimizerFunction · 0.92
optimizerEnvFunction · 0.85
ErrMethod · 0.80
ContainsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected