Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
akpsgit committed Apr 24, 2023
1 parent 33f32bd commit 020f0dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shared/pkg/families/rootkits/chkrootkit/chkrootkit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/openclarity/vmclarity/ui_backend/api/models"
"gotest.tools/v3/assert"

chkrootkitutils "github.com/openclarity/vmclarity/shared/pkg/families/rootkits/chkrootkit/utils"
Expand Down Expand Up @@ -68,7 +70,7 @@ func Test_toResultsRootkits(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := toResultsRootkits(tt.args.rootkits)
if diff := cmp.Diff(tt.want, got); diff != "" {
if diff := cmp.Diff(tt.want, got, cmpopts.SortSlices(func(a, b models.Rootkit) bool { return *a.RootkitName < *b.RootkitName })); diff != "" {
t.Errorf("toResultsRootkits() mismatch (-want +got):\n%s", diff)
}
})
Expand Down

0 comments on commit 020f0dd

Please sign in to comment.