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

Function TestCtrlLClearsPromptNotScrollback

internal/tui/tui_test.go:1485–1502  ·  view source on GitHub ↗

TestCtrlLClearsPromptNotScrollback: Ctrl+L matches Claude Code: it clears the typed input and forces a terminal redraw, but conversation scrollback stays. /clear is the only way to wipe history.

(t *testing.T)

Source from the content-addressed store, hash-verified

1483 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
1484 msg := m.errorMessage(llm.Event{Err: cloud.ErrUnauthorized})
1485 if !strings.Contains(msg, "key rejected") {
1486 t.Fatalf("401 error should say 'key rejected': %q", msg)
1487 }
1488 if !strings.Contains(msg, "models."+m.cfg.Active+".key") {
1489 t.Fatalf("401 error should name the active profile's key path: %q", msg)
1490 }
1491}
1492
1493// TestErrorMessageBudgetExhausted: 402 produces the depleted hint pointing
1494// users at the top-up page rather than a stack-trace style wrap.
1495func TestErrorMessageBudgetExhausted(t *testing.T) {
1496 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
1497 msg := m.errorMessage(llm.Event{Err: cloud.ErrBudgetExhausted})
1498 if !strings.Contains(msg, "depleted") {
1499 t.Fatalf("402 error should mention 'depleted': %q", msg)
1500 }
1501 if !strings.Contains(msg, "codehamr.com") {
1502 t.Fatalf("402 error should point at the top-up page: %q", msg)
1503 }
1504}
1505

Callers

nothing calls this directly

Calls 5

newTestModelFunction · 0.85
SetValueMethod · 0.80
ValueMethod · 0.80
StringMethod · 0.80
UpdateMethod · 0.45

Tested by

no test coverage detected