github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/configs/config_test.go (about) 1 package configs 2 3 import ( 4 "testing" 5 6 "github.com/go-test/deep" 7 ) 8 9 func TestConfigProviderTypes(t *testing.T) { 10 mod, diags := testModuleFromFile("testdata/valid-files/providers-explicit-implied.tf") 11 if diags.HasErrors() { 12 t.Fatal(diags.Error()) 13 } 14 15 cfg, diags := BuildConfig(mod, nil) 16 if diags.HasErrors() { 17 t.Fatal(diags.Error()) 18 } 19 20 got := cfg.ProviderTypes() 21 want := []string{ 22 "aws", 23 "null", 24 "template", 25 } 26 for _, problem := range deep.Equal(got, want) { 27 t.Error(problem) 28 } 29 }