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

Function TestVisualPromptLinesSumsAcrossLogicalLines

internal/tui/tui_test.go:2357–2369  ·  view source on GitHub ↗

TestVisualPromptLinesSumsAcrossLogicalLines: visualPromptLines splits on newlines and sums wrapRows for each segment: the prompt field grows to hold the combined visual height.

(t *testing.T)

Source from the content-addressed store, hash-verified

2355func TestWrapRowsMatchesBubblesBehaviour(t *testing.T) {
2356 cases := []struct {
2357 name string
2358 input string
2359 width int
2360 wantRows int
2361 }{
2362 {"empty", "", 15, 1},
2363 {"short fits", "hello", 15, 1},
2364 {"short with spaces fits", "hi you", 15, 1},
2365 {"exactly fills width adds cursor anchor", strings.Repeat("x", 15), 15, 2},
2366 {"just under width", strings.Repeat("x", 14), 15, 1},
2367 {"just over width hard-wraps", strings.Repeat("x", 16), 15, 2},
2368 {"long hard-wrap no spaces", strings.Repeat("x", 45), 15, 4},
2369 {"word-boundary wastes space", strings.Repeat("hello ", 20), 15, 10},
2370 {"zero width floors to 1", "anything", 0, 1},
2371 }
2372 for _, c := range cases {

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
SetValueMethod · 0.80
visualPromptLinesMethod · 0.80

Tested by

no test coverage detected