diff options
author | Alberto Cortés <alcortesm@gmail.com> | 2016-10-18 19:19:48 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-10-18 19:19:48 +0200 |
commit | c56b22fc73d0ca3c4d44872e8b16370e041dcd92 (patch) | |
tree | c7981c762d8c3f635cc5dd44508b43de9f61bc3f /storage/test | |
parent | 5f7d34066cc5583ee30a315e0661b5326dc548db (diff) | |
download | go-git-c56b22fc73d0ca3c4d44872e8b16370e041dcd92.tar.gz |
do not assume remotes are sorted chronologically (#87)
Diffstat (limited to 'storage/test')
-rw-r--r-- | storage/test/storage_suite.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/storage/test/storage_suite.go b/storage/test/storage_suite.go index fd5b3c7..dc500bb 100644 --- a/storage/test/storage_suite.go +++ b/storage/test/storage_suite.go @@ -2,6 +2,7 @@ package test import ( "io" + "sort" . "gopkg.in/check.v1" "gopkg.in/src-d/go-git.v4/config" @@ -274,6 +275,11 @@ func (s *BaseStorageSuite) TestConfigStorageRemotes(c *C) { r, err := s.ConfigStore.Remotes() c.Assert(err, IsNil) c.Assert(r, HasLen, 2) - c.Assert(r[0].Name, Equals, "foo") - c.Assert(r[1].Name, Equals, "bar") + + sorted := make([]string, 0, 2) + sorted = append(sorted, r[0].Name) + sorted = append(sorted, r[1].Name) + sort.Strings(sorted) + c.Assert(sorted[0], Equals, "bar") + c.Assert(sorted[1], Equals, "foo") } |