mirror of
https://github.com/walles/moar.git
synced 2024-11-22 21:50:43 +03:00
Test another corner case
It worked!
This commit is contained in:
parent
a082fe207e
commit
8478883821
@ -91,7 +91,7 @@ func TestRenderLineLastReversed(t *testing.T) {
|
||||
strings.ReplaceAll(reset+reversed+"<"+reset+clearToEol, "", "ESC"))
|
||||
}
|
||||
|
||||
func TestRenderLineLastReversedPlusTrailingSpaces(t *testing.T) {
|
||||
func TestRenderLineLastReversedPlusTrailingSpace(t *testing.T) {
|
||||
row := []Cell{
|
||||
{
|
||||
Rune: '<',
|
||||
@ -112,3 +112,21 @@ func TestRenderLineLastReversedPlusTrailingSpaces(t *testing.T) {
|
||||
strings.ReplaceAll(rendered, "", "ESC"),
|
||||
strings.ReplaceAll(reset+reversed+"<"+reset+clearToEol, "", "ESC"))
|
||||
}
|
||||
|
||||
func TestRenderLineLastReversedSpaces(t *testing.T) {
|
||||
row := []Cell{
|
||||
{
|
||||
Rune: ' ',
|
||||
Style: StyleDefault.WithAttr(AttrReverse),
|
||||
},
|
||||
}
|
||||
|
||||
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