MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestSubmitStreamsUpToDone

Function TestSubmitStreamsUpToDone

internal/tui/tui_test.go:1017–1028  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1015 }
1016}
1017
1018func TestSubmitStreamsUpToDone(t *testing.T) {
1019 m := newTestModel(t, func(w http.ResponseWriter, _ *http.Request) {
1020 w.Header().Set("Content-Type", "text/event-stream")
1021 fmt.Fprintf(w, "data: %s\n\n", `{"choices":[{"delta":{"content":"pong"}}]}`)
1022 fmt.Fprint(w, "data: [DONE]\n\n")
1023 })
1024 mm, cmd := m.submit("ping", "ping", promptEntry{display: "ping"})
1025 out, _ := drain(mm, cmd)
1026 if got := out.(Model).scroll.String(); !strings.Contains(got, "pong") {
1027 t.Fatalf("assistant output missing: %q", got)
1028 }
1029}
1030
1031func TestToolCallRoundTripExecutesBash(t *testing.T) {

Callers

nothing calls this directly

Calls 4

newTestModelFunction · 0.85
drainFunction · 0.85
submitMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected