1
1
mirror of https://github.com/walles/moar.git synced 2024-11-22 21:50:43 +03:00

Cover one more mutation

This commit is contained in:
Johan Walles 2023-10-10 21:33:18 +02:00
parent 5313c02dd6
commit 40a5ab1430

View File

@ -99,6 +99,23 @@ func TestRenderLineLastReversed(t *testing.T) {
strings.ReplaceAll(reset+reversed+"<"+reset+clearToEol, "", "ESC"))
}
func TestRenderLineLastNonSpace(t *testing.T) {
row := []Cell{
{
Rune: 'X',
Style: StyleDefault,
},
}
rendered, count := renderLine(row)
assert.Equal(t, count, 1)
reset := ""
clearToEol := ""
assert.Equal(t,
strings.ReplaceAll(rendered, "", "ESC"),
strings.ReplaceAll(reset+"X"+clearToEol, "", "ESC"))
}
func TestRenderLineLastReversedPlusTrailingSpace(t *testing.T) {
row := []Cell{
{