wrapping problems

This commit is contained in:
Liam Galvin 2018-11-12 09:46:27 +00:00
parent df5aa7fbe7
commit 26be543e0e
1 changed files with 0 additions and 51 deletions

View File

@ -239,15 +239,6 @@ func TestCarriageReturnOnFullLine(t *testing.T) {
assert.Equal(t, "xxxxxxxxxxxxxxxxxxxx", lines[0].String())
}
func TestCarriageReturnOnOverflowedLine(t *testing.T) {
b := NewBuffer(20, 20, CellAttributes{})
b.Write([]rune("abcdeabcdeabcdeabcdezzzzz")...)
b.CarriageReturn()
b.Write([]rune("xxxxxxxxxxxxxxxxxxxx")...)
lines := b.GetVisibleLines()
assert.Equal(t, "xxxxxxxxxxxxxxxxxxxx", lines[0].String())
}
func TestCarriageReturnOnFullLastLine(t *testing.T) {
b := NewBuffer(20, 2, CellAttributes{})
b.Write([]rune("\nabcdeabcdeabcdeabcde\rxxxxxxxxxxxxxxxxxxxx")...)
@ -263,30 +254,6 @@ func TestCarriageReturnOnWrappedLine(t *testing.T) {
assert.Equal(t, "secret", lines[0].String())
}
func TestCarriageReturnOnOverWrappedLine(t *testing.T) {
/*
|hello
|secret
| sauce
|
|
|
|
|
|
|
*/
b := NewBuffer(6, 10, CellAttributes{})
b.Write([]rune("hello there!\rsecret sauce")...)
lines := b.GetVisibleLines()
require.Equal(t, 2, len(lines))
assert.Equal(t, "secret", lines[0].String())
assert.True(t, b.lines[1].wrapped)
assert.Equal(t, " sauce", lines[1].String())
}
func TestCarriageReturnOnLineThatDoesntExist(t *testing.T) {
b := NewBuffer(6, 10, CellAttributes{})
b.cursorY = 3
@ -410,24 +377,6 @@ func TestBackspace(t *testing.T) {
assert.Equal(t, "helpo", lines[0].String())
}
func TestBackspaceWithWrap(t *testing.T) {
b := NewBuffer(10, 5, CellAttributes{})
b.Write([]rune("hellohellohello")...)
b.Backspace()
b.Backspace()
b.Backspace()
b.Backspace()
b.Backspace()
b.Backspace()
b.Backspace()
b.Backspace()
b.Backspace()
b.Backspace()
b.EraseLineFromCursor()
lines := b.GetVisibleLines()
assert.Equal(t, "hello", lines[0].String())
}
func TestHorizontalResizeView(t *testing.T) {
b := NewBuffer(80, 10, CellAttributes{})