MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestQueueEmptyMidTurnIsNoOp

Function TestQueueEmptyMidTurnIsNoOp

internal/tui/queue_test.go:48–58  ·  view source on GitHub ↗

TestQueueEmptyMidTurnIsNoOp: Enter on a blank prompt mid-turn stays silent, so a reflexive Enter while watching the agent doesn't queue an empty slot.

(t *testing.T)

Source from the content-addressed store, hash-verified

46// TestQueueEmptyMidTurnIsNoOp: Enter on a blank prompt mid-turn stays silent, so
47// a reflexive Enter while watching the agent doesn't queue an empty slot.
48func TestQueueEmptyMidTurnIsNoOp(t *testing.T) {
49 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
50 m.phase = phaseThinking
51 if m.ta.Value() != "" {
52 t.Fatal("precondition: textarea empty")
53 }
54 out, _ := m.Update(tea.KeyMsg{Type: tea.KeyEnter})
55 if out.(Model).queued != nil {
56 t.Fatalf("empty mid-turn Enter must not queue, got %+v", out.(Model).queued)
57 }
58}
59
60// TestQueueSecondEnterAppends: a second mid-turn Enter appends (newline-joined)
61// to the existing slot, so a multi-part instruction builds up in one queued

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
ValueMethod · 0.80
UpdateMethod · 0.45

Tested by

no test coverage detected