From e312ffc2d821901e982f897de952944070f74f19 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Wed, 4 Sep 2024 10:25:58 +0100 Subject: [PATCH] lang/functions: Add test for ephemeralasnull (#35652) --- internal/lang/functions_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/lang/functions_test.go b/internal/lang/functions_test.go index 4aa6c8d3a0..33df86f464 100644 --- a/internal/lang/functions_test.go +++ b/internal/lang/functions_test.go @@ -364,10 +364,10 @@ func TestFunctions(t *testing.T) { }, "ephemeralasnull": { - // We can't actually test the main behavior of this one here - // because we don't have any ephemeral values in scope, so - // this is just to check that the function is registered. The - // real tests for this function are in package funcs. + { + `ephemeralasnull(local.ephemeral)`, + cty.NullVal(cty.String), + }, { `ephemeralasnull("not ephemeral")`, cty.StringVal("not ephemeral"), @@ -1340,6 +1340,7 @@ func TestFunctions(t *testing.T) { data := &dataForTests{ LocalValues: map[string]cty.Value{ "greeting_template": cty.StringVal("Hello, ${name}!"), + "ephemeral": cty.StringVal("ephemeral").Mark(marks.Ephemeral), }, } scope := &Scope{