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:
parent
da43e89b5f
commit
2697cee997
@ -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),
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user