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

Function TestDamagedLabelUniqueChipDropsOnlyItself

internal/tui/prompt_test.go:239–252  ·  view source on GitHub ↗

TestDamagedLabelUniqueChipDropsOnlyItself: the group-drop above must not over-trigger; a damaged label with no twin drops alone and the other chip keeps its mapping.

(t *testing.T)

Source from the content-addressed store, hash-verified

237// over-trigger; a damaged label with no twin drops alone and the other chip
238// keeps its mapping.
239func TestDamagedLabelUniqueChipDropsOnlyItself(t *testing.T) {
240 p := newChippablePrompt()
241 p, _ = p.Update(pasteKey(makePaste(8)))
242 p, _ = p.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune(" mid ")})
243 p, _ = p.Update(pasteKey(makePaste(15)))
244 p.setCursorRuneOffset(p.spans[0].end)
245 p, _ = p.Update(tea.KeyMsg{Type: tea.KeyCtrlW})
246 if len(p.spans) != 1 {
247 t.Fatalf("only the damaged chip should drop, got %d spans", len(p.spans))
248 }
249 if c := p.store[p.spans[0].id]; c.lines != 15 {
250 t.Fatalf("survivor should be the 15-line chip, got %d", c.lines)
251 }
252}
253
254// TestValueExpandsAllChips: Value() interleaves surrounding text with full
255// paste contents in order.

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected