TestCtrlDEmptyQuits: Ctrl+D on empty textarea returns a Quit command.
(t *testing.T)
| 84 | |
| 85 | // TestCtrlDEmptyQuits: Ctrl+D on empty textarea returns a Quit command. |
| 86 | func 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. |
nothing calls this directly
no test coverage detected