TestQueueSecondEnterAppends: a second mid-turn Enter appends (newline-joined) to the existing slot, so a multi-part instruction builds up in one queued prompt that fires as a single turn.
(t *testing.T)
| 61 | // to the existing slot, so a multi-part instruction builds up in one queued |
| 62 | // prompt that fires as a single turn. |
| 63 | func TestQueueSecondEnterAppends(t *testing.T) { |
| 64 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 65 | m.phase = phaseThinking |
| 66 | |
| 67 | m.ta.SetValue("run the tests") |
| 68 | o1, _ := m.Update(tea.KeyMsg{Type: tea.KeyEnter}) |
| 69 | m1 := o1.(Model) |
| 70 | |
| 71 | m1.ta.SetValue("then commit if green") |
| 72 | o2, _ := m1.Update(tea.KeyMsg{Type: tea.KeyEnter}) |
| 73 | m2 := o2.(Model) |
| 74 | |
| 75 | want := "run the tests\nthen commit if green" |
| 76 | if m2.queued == nil || m2.queued.send != want { |
| 77 | t.Fatalf("second Enter must append newline-joined, got %+v", m2.queued) |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | // TestQueueRefusesSlashMix: a slash command never newline-joins with a queued |
| 82 | // prompt, in either order. Joined slash-first, the whole slot would fire as ONE |
nothing calls this directly
no test coverage detected