From c56b22fc73d0ca3c4d44872e8b16370e041dcd92 Mon Sep 17 00:00:00 2001 From: Alberto Cortés Date: Tue, 18 Oct 2016 19:19:48 +0200 Subject: do not assume remotes are sorted chronologically (#87) --- storage/test/storage_suite.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'storage') 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") } -- cgit