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

Function TestHeightOnlyResizeDoesNotClear

internal/tui/resize_test.go:202–212  ·  view source on GitHub ↗

TestHeightOnlyResizeDoesNotClear: a height-only change can't induce the soft-wrap that breaks bubbletea's cursor math (no line widens), so the hardening path stays reserved for width narrowing.

(t *testing.T)

Source from the content-addressed store, hash-verified

200// soft-wrap that breaks bubbletea's cursor math (no line widens), so the
201// hardening path stays reserved for width changes.
202func TestHeightOnlyResizeDoesNotClear(t *testing.T) {
203 cfg, _, _ := config.Bootstrap(t.TempDir())
204 m := New(cfg, llm.New("http://x", cfg.ActiveProfile().LLM, ""), t.TempDir(), "test")
205 var mm tea.Model = m
206
207 mm, _ = mm.Update(tea.WindowSizeMsg{Width: 80, Height: 24})
208 _, cmd := mm.Update(tea.WindowSizeMsg{Width: 80, Height: 10})
209 if cmdYieldsClearScreen(cmd) {
210 t.Error("height-only resize must not request ClearScreen")
211 }
212}
213
214// countCmdLeaves runs cmd, recurses into the slice-shaped []tea.Cmd payload
215// of tea.BatchMsg / tea.sequenceMsg (both unexported), and counts leaves

Callers

nothing calls this directly

Calls 7

UpdateMethod · 0.95
BootstrapFunction · 0.92
NewFunction · 0.92
cmdYieldsClearScreenFunction · 0.85
ActiveProfileMethod · 0.80
ErrorMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected