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

Function TestHamrpassNoArgsShowsSetWhenKeyPresent

internal/tui/tui_test.go:2940–2951  ·  view source on GitHub ↗

TestHamrpassNoArgsShowsSetWhenKeyPresent: status line flips to `set` when the hamrpass profile already has a key.

(t *testing.T)

Source from the content-addressed store, hash-verified

2938 m.phase = phaseStreaming
2939 m.emptyNudged = true // a prior empty already nudged this turn
2940 m.pending = []chmctx.ToolCall{{ID: "c1", Name: "bash", Arguments: map[string]any{"cmd": "echo hi"}}}
2941 m.history = []chmctx.Message{
2942 {Role: chmctx.RoleUser, Content: "build it"},
2943 {Role: chmctx.RoleAssistant, ToolCalls: []chmctx.ToolCall{{ID: "c1", Name: "bash"}}},
2944 }
2945 out, _ := m.handleStreamClosed()
2946 if out.(Model).emptyNudged {
2947 t.Fatal("a round that issued a tool call (progress) must re-arm the empty reply latch, not leave it consumed for the rest of the turn")
2948 }
2949}
2950
2951// drainFinal submits a prompt and pumps the whole turn to completion, returning
2952// the settled model. Centralises the submit+drain dance the empty reply tests share.
2953func drainFinal(t *testing.T, m Model, prompt string) Model {
2954 t.Helper()

Callers

nothing calls this directly

Calls 5

newTestModelFunction · 0.85
stripANSIFunction · 0.85
SaveMethod · 0.80
runSlashMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected