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

Function TestDynamicBlockEval

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

Source from the content-addressed store, hash-verified

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