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

Function newTestFrame

interpreter/async_test.go:53–63  ·  view source on GitHub ↗

newTestFrame creates an ExecutionFrame with an evaluation context attached.

(t *testing.T, ctx context.Context)

Source from the content-addressed store, hash-verified

51
52// newTestFrame creates an ExecutionFrame with an evaluation context attached.
53func newTestFrame(t *testing.T, ctx context.Context) (*ExecutionFrame, func()) {
54 t.Helper()
55 frame, err := NewExecutionFrame(EmptyActivation())
56 if err != nil {
57 t.Fatalf("NewExecutionFrame() failed: %v", err)
58 }
59 if err := frame.SetContext(ctx, 0); err != nil {
60 t.Fatalf("SetContext() failed: %v", err)
61 }
62 return frame, frame.Close
63}
64
65// awaitResult re-evaluates ComputeResult until it returns a non-Unknown value or the deadline fires.
66func awaitResult(t *testing.T, frame *ExecutionFrame, completions <-chan int64, id int64, fn, overload string, impl functions.AsyncOp, args ...ref.Val) ref.Val {

Calls 3

SetContextMethod · 0.95
NewExecutionFrameFunction · 0.85
EmptyActivationFunction · 0.85

Tested by

no test coverage detected