@@ -139,6 +139,39 @@ func TestDataSet(t *testing.T) {
139139 ),
140140 }),
141141 },
142+ "write-tftypes-values" : {
143+ data : fwschemadata.Data {
144+ TerraformValue : tftypes .NewValue (tftypes.Object {
145+ AttributeTypes : map [string ]tftypes.Type {
146+ "name" : tftypes .String ,
147+ },
148+ }, map [string ]tftypes.Value {
149+ "name" : tftypes .NewValue (tftypes .String , "oldvalue" ),
150+ }),
151+ Schema : testschema.Schema {
152+ Attributes : map [string ]fwschema.Attribute {
153+ "name" : testschema.Attribute {
154+ Type : types .StringType ,
155+ Required : true ,
156+ },
157+ },
158+ },
159+ },
160+ val : tftypes .NewValue (tftypes.Object {
161+ AttributeTypes : map [string ]tftypes.Type {
162+ "name" : tftypes .String ,
163+ },
164+ }, map [string ]tftypes.Value {
165+ "name" : tftypes .NewValue (tftypes .String , "newvalue" ),
166+ }),
167+ expected : tftypes .NewValue (tftypes.Object {
168+ AttributeTypes : map [string ]tftypes.Type {
169+ "name" : tftypes .String ,
170+ },
171+ }, map [string ]tftypes.Value {
172+ "name" : tftypes .NewValue (tftypes .String , "newvalue" ),
173+ }),
174+ },
142175 "overwrite" : {
143176 data : fwschemadata.Data {
144177 TerraformValue : tftypes.Value {},
0 commit comments