1
1
mirror of https://github.com/walles/moar.git synced 2024-11-30 02:34:13 +03:00

Make tests pass

This commit is contained in:
Johan Walles 2022-08-07 15:26:14 +02:00
parent da43e89b5f
commit 2697cee997
2 changed files with 8 additions and 6 deletions

View File

@ -148,7 +148,7 @@ func NewPager(r *Reader) *Pager {
ShowStatusBar: true,
DeInit: true,
ScrollLeftHint: twin.NewCell('<', twin.StyleDefault.WithAttr(twin.AttrReverse)),
ScrollRightHint: twin.NewCell('<', twin.StyleDefault.WithAttr(twin.AttrReverse)),
ScrollRightHint: twin.NewCell('>', twin.StyleDefault.WithAttr(twin.AttrReverse)),
scrollPosition: newScrollPosition(name),
}
}

View File

@ -9,11 +9,13 @@ import (
)
func testHorizontalCropping(t *testing.T, contents string, firstIndex int, lastIndex int, expected string) {
pager := Pager{
screen: twin.NewFakeScreen(1+lastIndex-firstIndex, 99),
leftColumnZeroBased: firstIndex,
scrollPosition: newScrollPosition("testHorizontalCropping"),
}
pager := NewPager(nil)
pager.ShowLineNumbers = false
pager.screen = twin.NewFakeScreen(1+lastIndex-firstIndex, 99)
pager.leftColumnZeroBased = firstIndex
pager.scrollPosition = newScrollPosition("testHorizontalCropping")
lineContents := NewLine(contents)
screenLine := pager.renderLine(lineContents, 0)
assert.Equal(t, rowToString(screenLine[0].cells), expected)