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

Function TestConstantBlockEval

ext/bindings_test.go:521–529  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

519}
520
521func TestConstantBlockEval(t *testing.T) {
522 cb := &constantBlock{
523 expr: interpreter.NewConstValue(2, types.IntOne),
524 }
525 res := cb.Eval(cel.NoVars())
526 if res.Equal(types.IntOne) != types.True {
527 t.Errorf("cb.Eval() = %v, wanted 1", res)
528 }
529}
530
531func BenchmarkBlockEval(b *testing.B) {
532 fac := ast.NewExprFactory()

Callers

nothing calls this directly

Calls 4

EvalMethod · 0.95
NewConstValueFunction · 0.92
NoVarsFunction · 0.92
EqualMethod · 0.65

Tested by

no test coverage detected