From 72ec579807500eefd6d7806873d5cf035989b1d2 Mon Sep 17 00:00:00 2001 From: Kristin Laemmert Date: Fri, 14 Feb 2020 08:26:14 -0500 Subject: [PATCH] configs/decodeRequiredProviders test: before comparing slices (#24114) --- configs/provider_requirements_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configs/provider_requirements_test.go b/configs/provider_requirements_test.go index a51149e53..000cb0078 100644 --- a/configs/provider_requirements_test.go +++ b/configs/provider_requirements_test.go @@ -2,6 +2,7 @@ package configs import ( "fmt" + "sort" "testing" "github.com/google/go-cmp/cmp" @@ -124,6 +125,11 @@ func TestDecodeRequiredProvidersBlock_mixed(t *testing.T) { } got, diags := decodeRequiredProvidersBlock(block) + + sort.SliceStable(got, func(i, j int) bool { + return got[i].Name < got[j].Name + }) + if diags.HasErrors() { t.Fatalf("unexpected error") }