TestStatusBarLiveTimerAndFrozenSummary: during an active turn the bar shows the phase label plus a ticking wall-clock; at idle after a clean finish it shows the frozen ✓, the wall-clock duration, and the avg rate that divides into it (5000 tok ÷ 100s = 50 tok/s).
(t *testing.T)
| 2286 | {Role: chmctx.RoleAssistant, Content: coderLeak}, |
| 2287 | {Role: chmctx.RoleUser, Content: "go on"}, |
| 2288 | {Role: chmctx.RoleAssistant, Content: clean}, |
| 2289 | } |
| 2290 | if w := toolCallLeakWarning(hist); w != "" { |
| 2291 | t.Fatalf("only the newest assistant message should be checked, got %q", w) |
| 2292 | } |
| 2293 | } |
| 2294 | |
| 2295 | // TestStatusBarShowsSessionTokens: once the counter is non-zero it appears |
| 2296 | // in the status bar; at zero the bar stays quiet. |
| 2297 | func TestStatusBarShowsSessionTokens(t *testing.T) { |
| 2298 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 2299 | if strings.Contains(m.renderStatusBar(), "tok") { |
| 2300 | t.Fatalf("fresh session (0 tok) should not render counter: %q", m.renderStatusBar()) |
| 2301 | } |
| 2302 | m.sessionTokens = 1234 |
| 2303 | bar := m.renderStatusBar() |
| 2304 | if !strings.Contains(bar, "1.2k tok") { |
| 2305 | t.Fatalf("status bar should show compact session counter: %q", bar) |
| 2306 | } |
| 2307 | } |
| 2308 | |
| 2309 | // TestStatusBarLiveTimerAndFrozenSummary: during an active turn the bar shows |
| 2310 | // the phase label plus a ticking wall-clock; at idle after a clean finish it |
| 2311 | // shows the frozen ✓, the wall-clock duration, and the avg rate that divides |
| 2312 | // into it (5000 tok ÷ 100s = 50 tok/s). |
| 2313 | func TestStatusBarLiveTimerAndFrozenSummary(t *testing.T) { |
| 2314 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 2315 | |
| 2316 | m.phase = phaseStreaming |
nothing calls this directly
no test coverage detected