MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestStatusBarShowsSessionTokens

Function TestStatusBarShowsSessionTokens

internal/tui/tui_test.go:2272–2282  ·  view source on GitHub ↗

TestStatusBarShowsSessionTokens: once the counter is non-zero it appears in the status bar; at zero the bar stays quiet.

(t *testing.T)

Source from the content-addressed store, hash-verified

2270 if w := toolCallLeakWarning([]chmctx.Message{{Role: chmctx.RoleAssistant, Content: clean}}); w != "" {
2271 t.Fatalf("clean reply must not warn, got %q", w)
2272 }
2273 // A message that carried a real structured tool call never leaked, even if
2274 // its prose quotes the `<tool_call>` tag: the ToolCalls gate keeps it clean.
2275 withCall := chmctx.Message{
2276 Role: chmctx.RoleAssistant,
2277 Content: "Running the build via a <tool_call> now.",
2278 ToolCalls: []chmctx.ToolCall{{ID: "1", Name: "bash", Arguments: map[string]any{"cmd": "go build ./..."}}},
2279 }
2280 if w := toolCallLeakWarning([]chmctx.Message{withCall}); w != "" {
2281 t.Fatalf("a turn with a structured tool call must not warn on incidental prose, got %q", w)
2282 }
2283 // An old leak followed by a clean reply must stay silent: only the newest
2284 // assistant message is the one that just ended the turn.
2285 hist := []chmctx.Message{

Callers

nothing calls this directly

Calls 2

newTestModelFunction · 0.85
renderStatusBarMethod · 0.80

Tested by

no test coverage detected