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

Function TestSmallPasteStaysInline

internal/tui/prompt_test.go:56–70  ·  view source on GitHub ↗

TestSmallPasteStaysInline: a paste below threshold stays raw, no chip.

(t *testing.T)

Source from the content-addressed store, hash-verified

54
55// TestSmallPasteStaysInline: a paste below threshold stays raw, no chip.
56func TestSmallPasteStaysInline(t *testing.T) {
57 p := newChippablePrompt()
58 small := makePaste(3)
59 p, _ = p.Update(pasteKey(small))
60
61 if len(p.spans) != 0 {
62 t.Fatalf("small paste must not create chip, got spans=%+v", p.spans)
63 }
64 if got := p.DisplayValue(); got != small {
65 t.Fatalf("display value should equal raw paste, got %q", got)
66 }
67 if got := p.Value(); got != small {
68 t.Fatalf("expanded value should equal raw paste, got %q", got)
69 }
70}
71
72// TestLargePasteBecomesChip: a ≥pasteChipMinLines paste collapses to one chip.
73// DisplayValue shows the label, Value expands back to the original.

Callers

nothing calls this directly

Calls 6

newChippablePromptFunction · 0.85
makePasteFunction · 0.85
pasteKeyFunction · 0.85
DisplayValueMethod · 0.80
ValueMethod · 0.80
UpdateMethod · 0.45

Tested by

no test coverage detected