TestVisualPromptLinesSumsAcrossLogicalLines: visualPromptLines splits on newlines and sums wrapRows for each segment: the prompt field grows to hold the combined visual height.
(t *testing.T)
| 2355 | } |
| 2356 | |
| 2357 | // TestHandleStreamDrainsAfterCancel: buffered stream events can arrive after |
| 2358 | // Ctrl+C returned phase to idle. Processing them would write ghost tokens, re |
| 2359 | // populate m.pending, and credit a cancelled turn's usage to sessionTokens. |
| 2360 | // handleStream must drain only. |
| 2361 | func TestHandleStreamDrainsAfterCancel(t *testing.T) { |
| 2362 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 2363 | m.phase = phaseIdle // post cancel state |
| 2364 | m.sessionTokens = 100 |
| 2365 | |
| 2366 | out, _ := m.handleStream(llm.Event{Kind: llm.EventContent, Content: "ghost"}) |
| 2367 | om := out.(Model) |
| 2368 | if om.streaming.Len() != 0 { |
| 2369 | t.Fatalf("stale EventContent wrote to streaming: %q", om.streaming.String()) |
| 2370 | } |
| 2371 | out, _ = om.handleStream(llm.Event{Kind: llm.EventToolCall, ToolCall: &chmctx.ToolCall{ID: "c", Name: "bash"}}) |
| 2372 | om = out.(Model) |
nothing calls this directly
no test coverage detected