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

Function TestFrameDoubleClose

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

Source from the content-addressed store, hash-verified

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