configs/decodeRequiredProviders test: before comparing slices (#24114)
This commit is contained in:
parent
402c0ed10c
commit
72ec579807
|
@ -2,6 +2,7 @@ package configs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
|
@ -124,6 +125,11 @@ func TestDecodeRequiredProvidersBlock_mixed(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
got, diags := decodeRequiredProvidersBlock(block)
|
got, diags := decodeRequiredProvidersBlock(block)
|
||||||
|
|
||||||
|
sort.SliceStable(got, func(i, j int) bool {
|
||||||
|
return got[i].Name < got[j].Name
|
||||||
|
})
|
||||||
|
|
||||||
if diags.HasErrors() {
|
if diags.HasErrors() {
|
||||||
t.Fatalf("unexpected error")
|
t.Fatalf("unexpected error")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue