mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 23:16:30 +01:00
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:
@@ -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!")
|
||||
|
||||
Reference in New Issue
Block a user