diff --git a/decoder_test.go b/decoder_test.go index 2d936f1..3bf0ed9 100644 --- a/decoder_test.go +++ b/decoder_test.go @@ -178,7 +178,7 @@ func TestDecode_interface(t *testing.T) { "foo": []map[string]interface{}{ map[string]interface{}{ "name": "terraform_example", - "ingress": []interface{}{ + "ingress": []map[string]interface{}{ map[string]interface{}{ "from_port": 22, }, @@ -206,6 +206,36 @@ func TestDecode_interface(t *testing.T) { true, nil, }, + + { + "object_list.json", + false, + map[string]interface{}{ + "resource": []map[string]interface{}{ + map[string]interface{}{ + "aws_instance": []map[string]interface{}{ + map[string]interface{}{ + "db": []map[string]interface{}{ + map[string]interface{}{ + "vpc": "foo", + "provisioner": []map[string]interface{}{ + map[string]interface{}{ + "file": []map[string]interface{}{ + map[string]interface{}{ + "source": "foo", + "destination": "bar", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, } for _, tc := range cases { diff --git a/test-fixtures/object_list.json b/test-fixtures/object_list.json new file mode 100644 index 0000000..73f3674 --- /dev/null +++ b/test-fixtures/object_list.json @@ -0,0 +1,15 @@ +{ + "resource": { + "aws_instance": { + "db": { + "vpc": "foo", + "provisioner": [{ + "file": { + "source": "foo", + "destination": "bar" + } + }] + } + } + } +}