Files
opentf/internal/lang/eval/testing.go
Martin Atkins c64b02a1af lang/eval: Start of supporting module calls
This stops short of actually implementing the evaluation of a module call,
but gets the compilation behavior in place and the usual boilerplate for
handling multi-instance module calls.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-10-27 10:15:41 -07:00

20 lines
604 B
Go

// Copyright (c) The OpenTofu Authors
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2023 HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package eval
import (
"github.com/zclconf/go-cty/cty"
"github.com/opentofu/opentofu/internal/lang/exprs"
)
// InputValuesForTesting returns input variable definitions based on a constant
// map, intended for convenient test setup in unit tests where it only matters
// what the variable values are and not how they are provided.
func InputValuesForTesting(vals map[string]cty.Value) exprs.Valuer {
return exprs.ConstantValuer(cty.ObjectVal(vals))
}