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

Function TestAsyncSetupWithoutContextErrors

interpreter/async_test.go:1104–1123  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1102}
1103
1104func TestAsyncSetupWithoutContextErrors(t *testing.T) {
1105 frame, err := NewExecutionFrame(EmptyActivation())
1106 if err != nil {
1107 t.Fatalf("NewExecutionFrame() failed: %v", err)
1108 }
1109 defer frame.Close()
1110
1111 // No frame.SetContext called, so context is nil.
1112 completions := make(chan int64, 1)
1113 if err := frame.SetCompletions(completions); err == nil {
1114 t.Error("SetCompletions() succeeded without context, wanted error")
1115 }
1116 obs := &recordingObserver{}
1117 if err := frame.SetAsyncObserver(obs); err == nil {
1118 t.Error("SetAsyncObserver() succeeded without context, wanted error")
1119 }
1120 if err := frame.SetAsyncMaxConcurrency(2); err == nil {
1121 t.Error("SetAsyncMaxConcurrency() succeeded without context, wanted error")
1122 }
1123}

Callers

nothing calls this directly

Calls 7

CloseMethod · 0.95
SetCompletionsMethod · 0.95
SetAsyncObserverMethod · 0.95
NewExecutionFrameFunction · 0.85
EmptyActivationFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected