Skip to content

Commit

Permalink
internal/lang: ephemeralasnull: Add test for unknown values
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Sep 4, 2024
1 parent e312ffc commit 79af3d0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/lang/functions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,14 @@ func TestFunctions(t *testing.T) {
`ephemeralasnull("not ephemeral")`,
cty.StringVal("not ephemeral"),
},
{
`ephemeralasnull(local.unknown)`,
cty.UnknownVal(cty.String),
},
{
`ephemeralasnull(local.unknown_sensitive)`,
cty.UnknownVal(cty.String).Mark(marks.Sensitive),
},
},

"file": {
Expand Down Expand Up @@ -1341,6 +1349,8 @@ func TestFunctions(t *testing.T) {
LocalValues: map[string]cty.Value{
"greeting_template": cty.StringVal("Hello, ${name}!"),
"ephemeral": cty.StringVal("ephemeral").Mark(marks.Ephemeral),
"unknown": cty.UnknownVal(cty.String),
"unknown_sensitive": cty.UnknownVal(cty.String).Mark(marks.Sensitive),
},
}
scope := &Scope{
Expand Down

0 comments on commit 79af3d0

Please sign in to comment.