TestRightArrowAtChipStartJumpsToEnd: → skips the whole chip in one keystroke.
(t *testing.T)
| 153 | |
| 154 | // TestRightArrowAtChipStartJumpsToEnd: → skips the whole chip in one keystroke. |
| 155 | func TestRightArrowAtChipStartJumpsToEnd(t *testing.T) { |
| 156 | p := newChippablePrompt() |
| 157 | p, _ = p.Update(pasteKey(makePaste(9))) |
| 158 | p.setCursorRuneOffset(p.spans[0].start) |
| 159 | |
| 160 | wantEnd := p.spans[0].end |
| 161 | p, _ = p.Update(tea.KeyMsg{Type: tea.KeyRight}) |
| 162 | after := p.cursorRuneOffset() |
| 163 | |
| 164 | if after != wantEnd { |
| 165 | t.Fatalf("→ at chip.start should land at chip.end=%d, got %d", wantEnd, after) |
| 166 | } |
| 167 | if len(p.spans) != 1 { |
| 168 | t.Fatal("→ must not delete the chip") |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | // TestTwoChipsTrackedIndependently: two pastes make two chips; deleting the |
| 173 | // first leaves the second intact with its span shifted left. |
nothing calls this directly
no test coverage detected