Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit c56b22f

Browse files
alcortesmmcuadros
authored andcommitted
do not assume remotes are sorted chronologically (#87)
1 parent 5f7d340 commit c56b22f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

storage/test/storage_suite.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package test
22

33
import (
44
"io"
5+
"sort"
56

67
. "gopkg.in/check.v1"
78
"gopkg.in/src-d/go-git.v4/config"
@@ -274,6 +275,11 @@ func (s *BaseStorageSuite) TestConfigStorageRemotes(c *C) {
274275
r, err := s.ConfigStore.Remotes()
275276
c.Assert(err, IsNil)
276277
c.Assert(r, HasLen, 2)
277-
c.Assert(r[0].Name, Equals, "foo")
278-
c.Assert(r[1].Name, Equals, "bar")
278+
279+
sorted := make([]string, 0, 2)
280+
sorted = append(sorted, r[0].Name)
281+
sorted = append(sorted, r[1].Name)
282+
sort.Strings(sorted)
283+
c.Assert(sorted[0], Equals, "bar")
284+
c.Assert(sorted[1], Equals, "foo")
279285
}

0 commit comments

Comments
 (0)