mirror of
https://github.com/walles/moar.git
synced 2024-09-11 12:15:43 +03:00
Add trailing whitespace test
Failing.
This commit is contained in:
parent
d7c104e80a
commit
59a636205a
@ -90,3 +90,25 @@ func TestRenderLineLastReversed(t *testing.T) {
|
||||
strings.ReplaceAll(rendered, "", "ESC"),
|
||||
strings.ReplaceAll(reset+reversed+"<"+reset+clearToEol, "", "ESC"))
|
||||
}
|
||||
|
||||
func TestRenderLineLastReversedPlusTrailingSpaces(t *testing.T) {
|
||||
row := []Cell{
|
||||
{
|
||||
Rune: '<',
|
||||
Style: StyleDefault.WithAttr(AttrReverse),
|
||||
},
|
||||
{
|
||||
Rune: ' ',
|
||||
Style: StyleDefault,
|
||||
},
|
||||
}
|
||||
|
||||
rendered, count := renderLine(row)
|
||||
assert.Equal(t, count, 1)
|
||||
reset := "[m"
|
||||
reversed := "[7m"
|
||||
clearToEol := "[K"
|
||||
assert.Equal(t,
|
||||
strings.ReplaceAll(rendered, "", "ESC"),
|
||||
strings.ReplaceAll(reset+reversed+"<"+reset+clearToEol, "", "ESC"))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user