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

Function TestCtrlDEmptyQuits

internal/tui/tui_test.go:86–95  ·  view source on GitHub ↗

TestCtrlDEmptyQuits: Ctrl+D on empty textarea returns a Quit command.

(t *testing.T)

Source from the content-addressed store, hash-verified

84
85// TestCtrlDEmptyQuits: Ctrl+D on empty textarea returns a Quit command.
86func TestCtrlDEmptyQuits(t *testing.T) {
87 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
88 if m.ta.Value() != "" {
89 t.Fatal("precondition: textarea empty")
90 }
91 _, cmd := m.Update(tea.KeyMsg{Type: tea.KeyCtrlD})
92 if cmd == nil {
93 t.Fatal("Ctrl+D on empty input should return tea.Quit")
94 }
95}
96
97// TestCtrlDNonEmptyNoOp: Ctrl+D with text in the textarea is a no-op: no
98// quit and no character deletion.

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
ValueMethod · 0.80
UpdateMethod · 0.45

Tested by

no test coverage detected