Mark duplicated rows in table output (#2679)

* mark duplicated rows in table output

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* fix unit test

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman
2024-02-29 09:33:00 -05:00
committed by GitHub
parent 3ad91f2678
commit 6377465440
3 changed files with 36 additions and 14 deletions
+6 -6
View File
@@ -23,7 +23,7 @@ func TestTableEncoder(t *testing.T) {
)
}
func TestRemoveDuplicateRows(t *testing.T) {
func Test_markDuplicateRows(t *testing.T) {
data := [][]string{
{"1", "2", "3"},
{"a", "b", "c"},
@@ -35,13 +35,13 @@ func TestRemoveDuplicateRows(t *testing.T) {
}
expected := [][]string{
{"1", "2", "3"},
{"a", "b", "c"},
{"4", "5", "6"},
{"1", "2", "1"},
{"1", "2", "3", "(+2 duplicates)"},
{"a", "b", "c", "(+1 duplicate)"},
{"4", "5", "6", ""},
{"1", "2", "1", ""},
}
actual := removeDuplicateRows(data)
actual := markDuplicateRows(data)
if diffs := deep.Equal(expected, actual); len(diffs) > 0 {
t.Errorf("found diffs!")