MCPcopy Create free account
hub / github.com/compozy/agh / TestDecodeSSEPropagatesHandlerError

Function TestDecodeSSEPropagatesHandlerError

internal/cli/client_test.go:3176–3193  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3174}
3175
3176func TestDecodeSSEPropagatesHandlerError(t *testing.T) {
3177 t.Parallel()
3178
3179 wantErr := errors.New("boom")
3180 body := strings.Join([]string{
3181 "id: 1",
3182 "event: done",
3183 `data: {"ok":true}`,
3184 "",
3185 }, "\n")
3186
3187 err := decodeSSE(context.Background(), io.NopCloser(strings.NewReader(body)), func(SSEEvent) error {
3188 return wantErr
3189 })
3190 if !errors.Is(err, wantErr) {
3191 t.Fatalf("decodeSSE() error = %v, want %v", err, wantErr)
3192 }
3193}
3194
3195func TestDecodeSSEPreservesMultiLineData(t *testing.T) {
3196 t.Parallel()

Callers

nothing calls this directly

Calls 2

decodeSSEFunction · 0.85
IsMethod · 0.45

Tested by

no test coverage detected