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

Function TestOffsets

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

Source from the content-addressed store, hash-verified

76}
77
78func TestOffsets(t *testing.T) {
79 b := makeBufferForTesting(10, 3)
80 writeRaw(b, []rune("hello")...)
81 b.carriageReturn()
82 b.newLine()
83 writeRaw(b, []rune("hello")...)
84 b.carriageReturn()
85 b.newLine()
86 writeRaw(b, []rune("hello")...)
87 b.carriageReturn()
88 b.newLine()
89 writeRaw(b, []rune("hello")...)
90 b.carriageReturn()
91 b.newLine()
92 writeRaw(b, []rune("hello")...)
93 assert.Equal(t, uint16(10), b.ViewWidth())
94 assert.Equal(t, uint16(10), b.Width())
95 assert.Equal(t, uint16(3), b.ViewHeight())
96 assert.Equal(t, 5, b.Height())
97}
98
99func TestBufferWriteIncrementsCursorCorrectly(t *testing.T) {
100 b := makeBufferForTesting(5, 4)

Callers

nothing calls this directly

Calls 8

makeBufferForTestingFunction · 0.85
writeRawFunction · 0.85
carriageReturnMethod · 0.80
newLineMethod · 0.80
ViewWidthMethod · 0.80
WidthMethod · 0.80
ViewHeightMethod · 0.80
HeightMethod · 0.80

Tested by

no test coverage detected