diff --git a/pkg/tests/schema_pulumi_test.go b/pkg/tests/schema_pulumi_test.go index 2243722e6..feeb24bff 100644 --- a/pkg/tests/schema_pulumi_test.go +++ b/pkg/tests/schema_pulumi_test.go @@ -618,3 +618,35 @@ func TestDiffSetHashFailsOnNil(t *testing.T) { }, ) } + +func TestDefaultApplication(t *testing.T) { + t.Parallel() + + t.Run("non-empty default", func(t *testing.T) { + t.Parallel() + + res := map[string]*schema.Schema{ + "test": { + Type: schema.TypeString, + Optional: true, + Default: "hello", + }, + } + + crosstests.Create(t, res, cty.ObjectVal(map[string]cty.Value{})) + }) + + t.Run("empty default", func(t *testing.T) { + t.Parallel() + + res := map[string]*schema.Schema{ + "test": { + Type: schema.TypeString, + Optional: true, + Default: "", + }, + } + + crosstests.Create(t, res, cty.ObjectVal(map[string]cty.Value{})) + }) +}