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)
| 237 | // over-trigger; a damaged label with no twin drops alone and the other chip |
| 238 | // keeps its mapping. |
| 239 | func 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. |
nothing calls this directly
no test coverage detected