TestCRLFLineEndings: Windows \r\n counts each line once, not twice.
(t *testing.T)
| 421 | |
| 422 | // TestCRLFLineEndings: Windows \r\n counts each line once, not twice. |
| 423 | func TestCRLFLineEndings(t *testing.T) { |
| 424 | p := newChippablePrompt() |
| 425 | paste := strings.Repeat("line\r\n", 9) + "end" |
| 426 | p, _ = p.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune(paste), Paste: true}) |
| 427 | |
| 428 | if len(p.spans) != 1 { |
| 429 | t.Fatal("CRLF paste should chip") |
| 430 | } |
| 431 | wantLabel := "[Pasted text +10 lines]" |
| 432 | if got := p.DisplayValue(); got != wantLabel { |
| 433 | t.Fatalf("label line count wrong for CRLF; got %q want %q", |
| 434 | got, wantLabel) |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | // TestPasteWithoutFlagButWithNewlineStillChips: some terminals omit the |
| 439 | // bracketed paste flag, yet multi line content in one KeyMsg can't come from |
nothing calls this directly
no test coverage detected