MCPcopy
hub / github.com/liamg/darktile / TestShrinkingThenGrowing

Function TestShrinkingThenGrowing

internal/app/darktile/termutil/buffer_test.go:631–654  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

629}
630
631func 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
64601234567890123456789
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
656func TestShrinkingThenRestoring(t *testing.T) {
657 b := makeBufferForTesting(30, 100)

Callers

nothing calls this directly

Calls 7

makeBufferForTestingFunction · 0.85
writeRawFunction · 0.85
carriageReturnMethod · 0.80
newLineMethod · 0.80
resizeViewMethod · 0.80
GetVisibleLinesMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected