44 "fmt"
55 "io"
66 "net/http"
7+ "slices"
78 "strings"
89 "testing"
910
@@ -164,7 +165,7 @@ func Test_RepoMetadata(t *testing.T) {
164165 if err != nil {
165166 t .Errorf ("error resolving members: %v" , err )
166167 }
167- if ! sliceEqual (memberIDs , expectedMemberIDs ) {
168+ if ! slices . Equal (memberIDs , expectedMemberIDs ) {
168169 t .Errorf ("expected members %v, got %v" , expectedMemberIDs , memberIDs )
169170 }
170171
@@ -173,7 +174,7 @@ func Test_RepoMetadata(t *testing.T) {
173174 if err != nil {
174175 t .Errorf ("error resolving teams: %v" , err )
175176 }
176- if ! sliceEqual (teamIDs , expectedTeamIDs ) {
177+ if ! slices . Equal (teamIDs , expectedTeamIDs ) {
177178 t .Errorf ("expected teams %v, got %v" , expectedTeamIDs , teamIDs )
178179 }
179180
@@ -182,7 +183,7 @@ func Test_RepoMetadata(t *testing.T) {
182183 if err != nil {
183184 t .Errorf ("error resolving labels: %v" , err )
184185 }
185- if ! sliceEqual (labelIDs , expectedLabelIDs ) {
186+ if ! slices . Equal (labelIDs , expectedLabelIDs ) {
186187 t .Errorf ("expected labels %v, got %v" , expectedLabelIDs , labelIDs )
187188 }
188189
@@ -192,10 +193,10 @@ func Test_RepoMetadata(t *testing.T) {
192193 if err != nil {
193194 t .Errorf ("error resolving projects: %v" , err )
194195 }
195- if ! sliceEqual (projectIDs , expectedProjectIDs ) {
196+ if ! slices . Equal (projectIDs , expectedProjectIDs ) {
196197 t .Errorf ("expected projects %v, got %v" , expectedProjectIDs , projectIDs )
197198 }
198- if ! sliceEqual (projectV2IDs , expectedProjectV2IDs ) {
199+ if ! slices . Equal (projectV2IDs , expectedProjectV2IDs ) {
199200 t .Errorf ("expected projectsV2 %v, got %v" , expectedProjectV2IDs , projectV2IDs )
200201 }
201202
@@ -317,7 +318,7 @@ func Test_ProjectNamesToPaths(t *testing.T) {
317318 }
318319
319320 expectedProjectPaths := []string {"ORG/1" , "OWNER/REPO/2" , "ORG/2" , "OWNER/REPO/4" , "MONALISA/5" }
320- if ! sliceEqual (projectPaths , expectedProjectPaths ) {
321+ if ! slices . Equal (projectPaths , expectedProjectPaths ) {
321322 t .Errorf ("expected projects paths %v, got %v" , expectedProjectPaths , projectPaths )
322323 }
323324 })
@@ -375,7 +376,7 @@ func Test_ProjectNamesToPaths(t *testing.T) {
375376 }
376377
377378 expectedProjectPaths := []string {"ORG/2" , "OWNER/REPO/4" , "MONALISA/5" }
378- if ! sliceEqual (projectPaths , expectedProjectPaths ) {
379+ if ! slices . Equal (projectPaths , expectedProjectPaths ) {
379380 t .Errorf ("expected projects paths %v, got %v" , expectedProjectPaths , projectPaths )
380381 }
381382 })
@@ -489,20 +490,6 @@ func TestMembersToIDs(t *testing.T) {
489490 })
490491}
491492
492- func sliceEqual (a , b []string ) bool {
493- if len (a ) != len (b ) {
494- return false
495- }
496-
497- for i := range a {
498- if a [i ] != b [i ] {
499- return false
500- }
501- }
502-
503- return true
504- }
505-
506493func Test_RepoMilestones (t * testing.T ) {
507494 tests := []struct {
508495 state string
0 commit comments