MCPcopy
hub / github.com/hashicorp/hcl / TestTemplateExprGracefulValue

Function TestTemplateExprGracefulValue

hclsyntax/expression_template_test.go:441–450  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

439}
440
441func TestTemplateExprGracefulValue(t *testing.T) {
442 // we don't care about diags since we know it's invalid config
443 expr, _ := ParseTemplate([]byte(`prefix${provider::}`), "", hcl.Pos{Line: 1, Column: 1, Byte: 0})
444
445 got, _ := expr.Value(nil) // this should not panic
446
447 if !got.RawEquals(cty.UnknownVal(cty.String).RefineNotNull()) {
448 t.Errorf("wrong result\ngot: %#v\nwant: %#v", got, cty.UnknownVal(cty.String).RefineNotNull())
449 }
450}
451
452func TestTemplateExprWrappedGracefulValue(t *testing.T) {
453 // we don't care about diags since we know it's invalid config

Callers

nothing calls this directly

Calls 2

ParseTemplateFunction · 0.85
ValueMethod · 0.65

Tested by

no test coverage detected