TestVerifyNudgeSkipsHonestUnverifiedFinish: a substantial turn whose summary already marks something `unverified` has done the honest self-assessment the nudge exists to elicit (it is the OPPOSITE of a false green) so it must finish without a re-prompt. Guards the round-5 regression where re-prompti
(t *testing.T)
| 2148 | name string |
| 2149 | input string |
| 2150 | width int |
| 2151 | wantRows int |
| 2152 | }{ |
| 2153 | {"empty", "", 15, 1}, |
| 2154 | {"short fits", "hello", 15, 1}, |
| 2155 | {"short with spaces fits", "hi you", 15, 1}, |
| 2156 | {"exactly fills width adds cursor anchor", strings.Repeat("x", 15), 15, 2}, |
| 2157 | {"just under width", strings.Repeat("x", 14), 15, 1}, |
| 2158 | {"just over width hard-wraps", strings.Repeat("x", 16), 15, 2}, |
| 2159 | {"long hard-wrap no spaces", strings.Repeat("x", 45), 15, 4}, |
| 2160 | {"word-boundary wastes space", strings.Repeat("hello ", 20), 15, 10}, |
| 2161 | {"zero width floors to 1", "anything", 0, 1}, |
| 2162 | } |
| 2163 | for _, c := range cases { |
| 2164 | if got := wrapRows(c.input, c.width); got != c.wantRows { |
| 2165 | t.Errorf("wrapRows(%q, %d) = %d, want %d", c.input, c.width, got, c.wantRows) |
| 2166 | } |
| 2167 | } |
| 2168 | } |
| 2169 | |
| 2170 | // TestVisualPromptLinesSumsAcrossLogicalLines: visualPromptLines splits on |
| 2171 | // newlines and sums wrapRows for each segment: the prompt field grows to |
| 2172 | // hold the combined visual height. |
| 2173 | func TestVisualPromptLinesSumsAcrossLogicalLines(t *testing.T) { |
| 2174 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 2175 | // width=100, effective=96. Two short logical lines = 2 visual rows. |
| 2176 | m.ta.SetValue("first line\nsecond line") |
nothing calls this directly
no test coverage detected