mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-29 10:21:01 -06:00
30 lines
505 B
Go
30 lines
505 B
Go
|
package configs
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/go-test/deep"
|
||
|
)
|
||
|
|
||
|
func TestConfigProviderTypes(t *testing.T) {
|
||
|
mod, diags := testModuleFromFile("test-fixtures/valid-files/providers-explicit-implied.tf")
|
||
|
if diags.HasErrors() {
|
||
|
t.Fatal(diags.Error())
|
||
|
}
|
||
|
|
||
|
cfg, diags := BuildConfig(mod, nil)
|
||
|
if diags.HasErrors() {
|
||
|
t.Fatal(diags.Error())
|
||
|
}
|
||
|
|
||
|
got := cfg.ProviderTypes()
|
||
|
want := []string{
|
||
|
"aws",
|
||
|
"null",
|
||
|
"template",
|
||
|
}
|
||
|
for _, problem := range deep.Equal(got, want) {
|
||
|
t.Error(problem)
|
||
|
}
|
||
|
}
|