2020-09-16 10:32:48 -05:00
|
|
|
package terraform
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2021-05-17 14:00:50 -05:00
|
|
|
"github.com/hashicorp/terraform/internal/addrs"
|
2021-05-17 14:17:09 -05:00
|
|
|
"github.com/hashicorp/terraform/internal/configs"
|
2021-09-10 09:58:44 -05:00
|
|
|
"github.com/zclconf/go-cty/cty"
|
2020-09-16 10:32:48 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestNodeRootVariableExecute(t *testing.T) {
|
|
|
|
ctx := new(MockEvalContext)
|
|
|
|
|
|
|
|
n := &NodeRootVariable{
|
|
|
|
Addr: addrs.InputVariable{Name: "foo"},
|
|
|
|
Config: &configs.Variable{
|
2021-09-10 09:58:44 -05:00
|
|
|
Name: "foo",
|
|
|
|
Type: cty.String,
|
|
|
|
ConstraintType: cty.String,
|
2020-09-16 10:32:48 -05:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2020-10-28 12:47:04 -05:00
|
|
|
diags := n.Execute(ctx, walkApply)
|
|
|
|
if diags.HasErrors() {
|
|
|
|
t.Fatalf("unexpected error: %s", diags.Err())
|
2020-09-16 10:32:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|