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

Function TestDynamicBlockEval

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

Source from the content-addressed store, hash-verified

505}
506
507func TestDynamicBlockEval(t *testing.T) {
508 db := &dynamicBlock{
509 expr: interpreter.NewConstValue(1, types.IntOne),
510 slotActivationPool: &sync.Pool{
511 New: func() any {
512 return &dynamicSlotActivation{}
513 },
514 },
515 }
516 res := db.Eval(cel.NoVars())
517 if res.Equal(types.IntOne) != types.True {
518 t.Errorf("db.Eval() = %v, wanted 1", res)
519 }
520}
521
522func TestConstantBlockEval(t *testing.T) {
523 cb := &constantBlock{

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