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

Function TestEraseDisplayToCursor

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

Source from the content-addressed store, hash-verified

491 }
492}
493func TestEraseDisplayToCursor(t *testing.T) {
494 b := makeBufferForTesting(80, 5)
495 writeRaw(b, []rune("hello")...)
496 b.carriageReturn()
497 b.newLine()
498 writeRaw(b, []rune("asdasd")...)
499 b.carriageReturn()
500 b.newLine()
501 writeRaw(b, []rune("thing")...)
502 b.movePosition(-2, 0)
503 b.eraseDisplayToCursor()
504 lines := b.GetVisibleLines()
505 assert.Equal(t, "", lines[0].String())
506 assert.Equal(t, "", lines[1].String())
507 assert.Equal(t, "\x00\x00\x00\x00g", lines[2].String())
508
509}
510
511func TestEraseDisplayFromCursor(t *testing.T) {
512 b := makeBufferForTesting(80, 5)

Callers

nothing calls this directly

Calls 8

makeBufferForTestingFunction · 0.85
writeRawFunction · 0.85
carriageReturnMethod · 0.80
newLineMethod · 0.80
movePositionMethod · 0.80
eraseDisplayToCursorMethod · 0.80
GetVisibleLinesMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected