From ea71ec0a8947448e9fc531a2b227e92fb34480db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Cort=C3=A9s?= Date: Tue, 18 Oct 2016 16:33:41 +0200 Subject: [PATCH] do not assume remotes are sorted chronologically --- storage/test/storage_suite.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/storage/test/storage_suite.go b/storage/test/storage_suite.go index fd5b3c774..dc500bbc9 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") }