mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-29 10:21:01 -06:00
f64d5b237c
EvalModuleCallArguments is now a method on nodeModuleVariable, it's only caller, and the other functions have been replaces with straight through code (or in the case of evalVariableValidations, a standalone function). I was unable to add tests for nodeModuleVariable.Execute, which requires fixtures that aren't part of the MockEvalContext (a scope.evalContext is one); it's not ideal but that function should be well covered by the context tests so I chose to leave it as-is. Finally, I removed the unused function hclTypeName. Deleting code is fun!
26 lines
430 B
Go
26 lines
430 B
Go
package terraform
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/addrs"
|
|
"github.com/hashicorp/terraform/configs"
|
|
)
|
|
|
|
func TestNodeRootVariableExecute(t *testing.T) {
|
|
ctx := new(MockEvalContext)
|
|
|
|
n := &NodeRootVariable{
|
|
Addr: addrs.InputVariable{Name: "foo"},
|
|
Config: &configs.Variable{
|
|
Name: "foo",
|
|
},
|
|
}
|
|
|
|
err := n.Execute(ctx, walkApply)
|
|
if err != nil {
|
|
t.Fatalf("unexpected error: %s", err.Error())
|
|
}
|
|
|
|
}
|