From eb147039b6ecd425401e43c85448a324268b9ef7 Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Sun, 12 Apr 2020 20:46:18 +0200 Subject: [PATCH] fix: sort companies before comparing since map-iteration is not stable --- client_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client_test.go b/client_test.go index 0c9bb5e..d6dde38 100644 --- a/client_test.go +++ b/client_test.go @@ -5,6 +5,7 @@ import ( "github.com/stretchr/testify/assert" "net/http" "net/http/httptest" + "sort" "testing" ) @@ -64,7 +65,7 @@ func TestPrivilegeHandler_Process_UserAdded_And_UserRemoved(t *testing.T) { companies := handler.CompaniesByUser("jim@example.org", func(privileges CompanyPrivileges) bool { return true }) - + sort.Strings(companies) assert.Equal(t, []string{"abc-123", "abc-456"}, companies) result = handler.Process(&UserRemoved{