TestCtrlDNonEmptyNoOp: Ctrl+D with text in the textarea is a no-op: no quit and no character deletion.
(t *testing.T)
| 97 | // TestCtrlDNonEmptyNoOp: Ctrl+D with text in the textarea is a no-op: no |
| 98 | // quit and no character deletion. |
| 99 | func 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 |
nothing calls this directly
no test coverage detected