TestLongSingleLinePasteChipsByCharCount: a long single-line blob (zero newlines) still collapses: char threshold catches minified JSON and one-line stack traces that line-count alone would miss.
(t *testing.T)
| 455 | // newlines) still collapses: char threshold catches minified JSON and |
| 456 | // one-line stack traces that line-count alone would miss. |
| 457 | func TestLongSingleLinePasteChipsByCharCount(t *testing.T) { |
| 458 | p := newChippablePrompt() |
| 459 | big := strings.Repeat("x", 500) |
| 460 | p, _ = p.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune(big), Paste: true}) |
| 461 | if len(p.spans) != 1 { |
| 462 | t.Fatalf("long single-line paste should chip by char threshold; spans=%+v", p.spans) |
| 463 | } |
| 464 | wantLabel := "[Pasted text +1 lines]" |
| 465 | if got := p.DisplayValue(); got != wantLabel { |
| 466 | t.Fatalf("DisplayValue = %q, want %q", got, wantLabel) |
| 467 | } |
| 468 | } |
| 469 | |
| 470 | // TestBackspaceImmediatelyAfterChipRemovesIt: atomic-delete regression guard, |
| 471 | // after a paste the cursor sits at chip.end, so one Backspace deletes the chip |
nothing calls this directly
no test coverage detected