TestEventDoneFlushesStreamingThroughGlamour: EventDone moves raw streamed text into the committed scroll via the Markdown renderer and empties the streaming buffer. After Done, scroll contains the rendered block and the streaming buffer is empty.
(t *testing.T)
| 2476 | |
| 2477 | // TestStreamContentShowsLiveInViewport: a mid-turn content event populates the |
| 2478 | // streaming buffer, promotes phase thinking→streaming, and is visible in View() |
| 2479 | // before any EventDone: the "tokens stream immediately" promise. |
| 2480 | func TestStreamContentShowsLiveInViewport(t *testing.T) { |
| 2481 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 2482 | m.phase = phaseThinking |
| 2483 | out, _ := m.handleStream(llm.Event{Kind: llm.EventContent, Content: "hello world"}) |
| 2484 | om := out.(Model) |
| 2485 | if om.phase != phaseStreaming { |
| 2486 | t.Fatalf("first content chunk should promote phase to streaming, got %v", om.phase) |
| 2487 | } |
| 2488 | if om.streaming.String() != "hello world" { |
| 2489 | t.Fatalf("streaming buffer should contain raw content, got %q", om.streaming.String()) |
| 2490 | } |
| 2491 | if om.scroll.Len() != 0 { |
| 2492 | t.Fatalf("scroll should still be empty before flush, got %q", om.scroll.String()) |
| 2493 | } |
nothing calls this directly
no test coverage detected