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

Function TestConstantBlockEval

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

Source from the content-addressed store, hash-verified

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