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

Function TestFrameClose

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

Source from the content-addressed store, hash-verified

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

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