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

Function TestAsyncSetupWithoutContextErrors

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

Source from the content-addressed store, hash-verified

1025}
1026
1027func TestAsyncSetupWithoutContextErrors(t *testing.T) {
1028 frame, err := NewExecutionFrame(EmptyActivation())
1029 if err != nil {
1030 t.Fatalf("NewExecutionFrame() failed: %v", err)
1031 }
1032 defer frame.Close()
1033
1034 // No frame.SetContext called, so context is nil.
1035 completions := make(chan int64, 1)
1036 if err := frame.SetCompletions(completions); err == nil {
1037 t.Error("SetCompletions() succeeded without context, wanted error")
1038 }
1039 obs := &recordingObserver{}
1040 if err := frame.SetAsyncObserver(obs); err == nil {
1041 t.Error("SetAsyncObserver() succeeded without context, wanted error")
1042 }
1043 if err := frame.SetAsyncMaxConcurrency(2); err == nil {
1044 t.Error("SetAsyncMaxConcurrency() succeeded without context, wanted error")
1045 }
1046}

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