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

Function TestFrameClose

interpreter/frame_test.go:361–381  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

359}
360
361func TestFrameClose(t *testing.T) {
362 frame := mustNewExecutionFrame(t, EmptyActivation())
363 ctx := context.Background()
364 frame.SetContext(ctx, 1)
365
366 frameCtx := frame.ctx.ctx
367
368 select {
369 case <-frameCtx.Done():
370 t.Fatal("context canceled before Close()")
371 default:
372 }
373
374 frame.Close()
375
376 select {
377 case <-frameCtx.Done():
378 default:
379 t.Error("context not canceled after Close()")
380 }
381}
382
383func TestFrameLifecycleAndPooling(t *testing.T) {
384 vars := map[string]any{"a": 1, "b": 2}

Callers

nothing calls this directly

Calls 5

mustNewExecutionFrameFunction · 0.85
EmptyActivationFunction · 0.85
SetContextMethod · 0.80
CloseMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected