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

Function TestCtrlDNonEmptyNoOp

internal/tui/tui_test.go:99–109  ·  view source on GitHub ↗

TestCtrlDNonEmptyNoOp: Ctrl+D with text in the textarea is a no-op: no quit and no character deletion.

(t *testing.T)

Source from the content-addressed store, hash-verified

97// TestCtrlDNonEmptyNoOp: Ctrl+D with text in the textarea is a no-op: no
98// quit and no character deletion.
99func TestCtrlDNonEmptyNoOp(t *testing.T) {
100 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
101 m.ta.SetValue("half-written prompt")
102 out, cmd := m.Update(tea.KeyMsg{Type: tea.KeyCtrlD})
103 if cmd != nil {
104 t.Fatal("Ctrl+D with non-empty input must not quit")
105 }
106 if got := out.(Model).ta.Value(); got != "half-written prompt" {
107 t.Fatalf("textarea was modified: %q", got)
108 }
109}
110
111// TestCtrlDMidTurnDoesNotQuit: the textarea is empty during a running turn
112// (submit resets it), so without the phase gate a reflexive Ctrl+D would quit

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected