(t *testing.T)
| 629 | } |
| 630 | |
| 631 | func TestShrinkingThenGrowing(t *testing.T) { |
| 632 | b := makeBufferForTesting(30, 100) |
| 633 | writeRaw(b, []rune("hellohellohellohellohello")...) |
| 634 | b.carriageReturn() |
| 635 | b.newLine() |
| 636 | writeRaw(b, []rune("01234567890123456789")...) |
| 637 | b.carriageReturn() |
| 638 | b.newLine() |
| 639 | |
| 640 | b.resizeView(25, 100) |
| 641 | b.resizeView(24, 100) |
| 642 | |
| 643 | b.resizeView(30, 100) |
| 644 | |
| 645 | expected := `hellohellohellohellohello |
| 646 | 01234567890123456789 |
| 647 | ` |
| 648 | lines := b.GetVisibleLines() |
| 649 | var strs []string |
| 650 | for _, l := range lines { |
| 651 | strs = append(strs, l.String()) |
| 652 | } |
| 653 | require.Equal(t, expected, strings.Join(strs, "\n")) |
| 654 | } |
| 655 | |
| 656 | func TestShrinkingThenRestoring(t *testing.T) { |
| 657 | b := makeBufferForTesting(30, 100) |
nothing calls this directly
no test coverage detected