MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestRedundantResizeIsNoOp

Function TestRedundantResizeIsNoOp

internal/tui/resize_test.go:166–176  ·  view source on GitHub ↗

TestRedundantResizeIsNoOp: a WindowSizeMsg with unchanged dimensions (some terminals send these on focus) must not fire the hardening path; clearing the screen for a non-event flickers for no benefit.

(t *testing.T)

Source from the content-addressed store, hash-verified

164// (some terminals send these on focus) must not fire the hardening path;
165// clearing the screen for a non-event flickers for no benefit.
166func TestRedundantResizeIsNoOp(t *testing.T) {
167 cfg, _, _ := config.Bootstrap(t.TempDir())
168 m := New(cfg, llm.New("http://x", cfg.ActiveProfile().LLM, ""), t.TempDir(), "test")
169 var mm tea.Model = m
170
171 mm, _ = mm.Update(tea.WindowSizeMsg{Width: 80, Height: 24})
172 _, cmd := mm.Update(tea.WindowSizeMsg{Width: 80, Height: 24})
173 if cmdYieldsClearScreen(cmd) {
174 t.Error("same-size resize must not request ClearScreen")
175 }
176}
177
178// TestWidenResizeAlsoSuppresses: widening changes the splash layout
179// (text→art at the wordmark threshold) and leaves narrow rows misplaced,

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