Documentation ¶
Index ¶
- func Decode(t *testing.T, spec dataspec.RootSpec, body string) (v cty.Value, diags diagnostics.Diag)
- func DecodeAndAssert(t *testing.T, spec dataspec.RootSpec, body string, dataCtx plugin.MapData, ...) (v cty.Value)
- func ReencodeCTY(t *testing.T, spec dataspec.RootSpec, val cty.Value, ...) cty.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeAndAssert ¶
func DecodeAndAssert(t *testing.T, spec dataspec.RootSpec, body string, dataCtx plugin.MapData, asserts diagtest.Asserts) (v cty.Value)
Decodes a string (representing content of a config/data/content block) into cty.Value according to given spec (i.e. respecting default values)
func ReencodeCTY ¶
func ReencodeCTY(t *testing.T, spec dataspec.RootSpec, val cty.Value, asserts [][]diagtest.Assert) cty.Value
We have a massive amount of tests that break as soon as we add schemas with default values. This function is a workaround. It reencodes provided cty.Value to hcl text and then re-parses that text in accordance to spec. Ugly hack, but there's over a 100 tests in need of a rewrite that can't be automated with regex or similar. New tests should use Decode and provide a string of hcl.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.