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

Function TestSetPosition

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

Source from the content-addressed store, hash-verified

197}
198
199func TestSetPosition(t *testing.T) {
200 b := makeBufferForTesting(120, 80)
201 assert.Equal(t, 0, int(b.CursorColumn()))
202 assert.Equal(t, 0, int(b.CursorLine()))
203
204 b.setPosition(60, 10)
205 assert.Equal(t, 60, int(b.CursorColumn()))
206 assert.Equal(t, 10, int(b.CursorLine()))
207
208 b.setPosition(0, 0)
209 assert.Equal(t, 0, int(b.CursorColumn()))
210 assert.Equal(t, 0, int(b.CursorLine()))
211
212 b.setPosition(120, 90)
213 assert.Equal(t, 119, int(b.CursorColumn()))
214 assert.Equal(t, 79, int(b.CursorLine()))
215
216}
217
218func TestMovePosition(t *testing.T) {
219 b := makeBufferForTesting(120, 80)

Callers

nothing calls this directly

Calls 4

makeBufferForTestingFunction · 0.85
CursorColumnMethod · 0.80
CursorLineMethod · 0.80
setPositionMethod · 0.80

Tested by

no test coverage detected