Skip to content

Commit 6fd7049

Browse files
committed
Test type-morphing of Map to Map
1 parent 7a1f34b commit 6fd7049

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

manifest/morph/morph_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,21 @@ func TestMorphValueToType(t *testing.T) {
254254
"three": tftypes.NewValue(tftypes.String, "baz"),
255255
}),
256256
},
257+
"map->map": {
258+
In: sampleInType{
259+
V: tftypes.NewValue(tftypes.Map{AttributeType: tftypes.String}, map[string]tftypes.Value{
260+
"one": tftypes.NewValue(tftypes.String, "foo"),
261+
"two": tftypes.NewValue(tftypes.String, "bar"),
262+
"three": tftypes.NewValue(tftypes.String, "baz"),
263+
}),
264+
T: tftypes.Map{AttributeType: tftypes.String},
265+
},
266+
Out: tftypes.NewValue(tftypes.Map{AttributeType: tftypes.String}, map[string]tftypes.Value{
267+
"one": tftypes.NewValue(tftypes.String, "foo"),
268+
"two": tftypes.NewValue(tftypes.String, "bar"),
269+
"three": tftypes.NewValue(tftypes.String, "baz"),
270+
}),
271+
},
257272
"object->map": {
258273
In: sampleInType{
259274
V: tftypes.NewValue(tftypes.Object{AttributeTypes: map[string]tftypes.Type{

0 commit comments

Comments
 (0)