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

Function TestFrameDoubleClose

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

Source from the content-addressed store, hash-verified

381}
382
383func TestFrameDoubleClose(t *testing.T) {
384 frame := mustNewExecutionFrame(t, EmptyActivation())
385 ctx := context.Background()
386 frame.SetContext(ctx, 1)
387
388 // Close the frame the first time.
389 frame.Close()
390
391 // Closing it again should be a no-op and not panic.
392 defer func() {
393 if r := recover(); r != nil {
394 t.Errorf("double Close() panicked: %v", r)
395 }
396 }()
397 frame.Close()
398}
399
400func TestFrameLifecycleAndPooling(t *testing.T) {
401 vars := map[string]any{"a": 1, "b": 2}

Callers

nothing calls this directly

Calls 4

mustNewExecutionFrameFunction · 0.85
EmptyActivationFunction · 0.85
SetContextMethod · 0.80
CloseMethod · 0.80

Tested by

no test coverage detected