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

Function TestNewLine

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

Source from the content-addressed store, hash-verified

26}
27
28func TestNewLine(t *testing.T) {
29 b := makeBufferForTesting(30, 3)
30 writeRaw(b, []rune("hello")...)
31 b.carriageReturn()
32 b.newLine()
33 writeRaw(b, []rune("goodbye")...)
34 b.carriageReturn()
35 b.newLine()
36 expected := `
37hello
38goodbye
39`
40
41 lines := b.GetVisibleLines()
42 strs := []string{}
43 for _, l := range lines {
44 strs = append(strs, l.String())
45 }
46 require.Equal(t, strings.TrimSpace(expected), strings.TrimSpace(strings.Join(strs, "\n")))
47}
48
49func TestTabbing(t *testing.T) {
50 b := makeBufferForTesting(30, 3)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected