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

Function TestValueExpandsAllChips

internal/tui/prompt_test.go:256–270  ·  view source on GitHub ↗

TestValueExpandsAllChips: Value() interleaves surrounding text with full paste contents in order.

(t *testing.T)

Source from the content-addressed store, hash-verified

254// TestValueExpandsAllChips: Value() interleaves surrounding text with full
255// paste contents in order.
256func TestValueExpandsAllChips(t *testing.T) {
257 p := newChippablePrompt()
258 paste1 := makePaste(9)
259 paste2 := makePaste(11)
260 p, _ = p.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune("A ")})
261 p, _ = p.Update(pasteKey(paste1))
262 p, _ = p.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune(" B ")})
263 p, _ = p.Update(pasteKey(paste2))
264 p, _ = p.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune(" C")})
265
266 want := "A " + paste1 + " B " + paste2 + " C"
267 if got := p.Value(); got != want {
268 t.Fatalf("Value expansion wrong:\nwant %q\ngot %q", want, got)
269 }
270}
271
272// TestTypingShiftsSpans: typing before a chip shifts its span right by one;
273// reconcile tracks it automatically.

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected