1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-31 22:22:14 +02:00

Add failing test demonstrating bug with column alignments and removed columns

When columns to the left of a column with an alignment are removed, the
alignment applies to the wrong column. We'll fix this in the next commit.
This commit is contained in:
Stefan Haller 2023-08-19 08:09:24 +02:00
parent 72731f2c16
commit aa493d3a9e

View File

@ -209,6 +209,14 @@ func TestRenderDisplayStrings(t *testing.T) {
columnAlignments: []Alignment{AlignRight, AlignLeft},
expected: "abc d\n e f",
},
{
input: [][]string{{"a", "", "bcd", "efg", "h"}, {"i", "", "j", "k", "l"}},
columnAlignments: []Alignment{AlignLeft, AlignLeft, AlignRight, AlignLeft},
expected: "a bcd efg h\ni j k l",
/* Wrong, it should really be:
expected: "a bcd efg h\ni j k l",
*/
},
{
input: [][]string{{"abc", "", "d", ""}, {"e", "", "f", ""}},
columnAlignments: []Alignment{AlignRight}, // gracefully defaults unspecified columns to left-align