File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ import (
2020 "context"
2121 "errors"
2222 "fmt"
23+ "maps"
24+ "slices"
2325 "testing"
2426
2527 "github.com/google/go-cmp/cmp"
@@ -492,8 +494,13 @@ func TestFetchAllClusterResourceSnapshots(t *testing.T) {
492494 return s1 < s2
493495 }),
494496 }
495- if diff := cmp .Diff (tc .want , got , options ... ); diff != "" {
496- t .Errorf ("FetchAllClusterResourceSnapshots() mismatch (-want, +got):\n %s" , diff )
497+ theSortedKeys := slices .Sorted (maps .Keys (got ))
498+ for i := range theSortedKeys {
499+ key := theSortedKeys [i ]
500+ wantResourceSnapshotObj := tc .want [key ]
501+ if diff := cmp .Diff (wantResourceSnapshotObj , got [key ], options ... ); diff != "" {
502+ t .Errorf ("FetchAllClusterResourceSnapshots() mismatch (-want, +got):\n %s" , diff )
503+ }
497504 }
498505 })
499506 }
You can’t perform that action at this time.
0 commit comments