Skip to content

Commit 7279487

Browse files
committed
sort the listresources result to prevent false positives in test
1 parent 76b7831 commit 7279487

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

internal/proto5server/server_getmetadata_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,10 @@ func TestServerGetMetadata(t *testing.T) {
810810
return got.Functions[i].Name < got.Functions[j].Name
811811
})
812812

813+
sort.Slice(got.ListResources, func(i int, j int) bool {
814+
return got.ListResources[i].TypeName < got.ListResources[j].TypeName
815+
})
816+
813817
sort.Slice(got.Resources, func(i int, j int) bool {
814818
return got.Resources[i].TypeName < got.Resources[j].TypeName
815819
})

internal/proto6server/server_getmetadata_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,10 @@ func TestServerGetMetadata(t *testing.T) {
810810
return got.Functions[i].Name < got.Functions[j].Name
811811
})
812812

813+
sort.Slice(got.ListResources, func(i int, j int) bool {
814+
return got.ListResources[i].TypeName < got.ListResources[j].TypeName
815+
})
816+
813817
sort.Slice(got.Resources, func(i int, j int) bool {
814818
return got.Resources[i].TypeName < got.Resources[j].TypeName
815819
})

0 commit comments

Comments
 (0)