test for decoding structures within lists
This commit is contained in:
parent
15fce08259
commit
338eebdbf7
@ -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 {
|
||||
|
15
test-fixtures/object_list.json
Normal file
15
test-fixtures/object_list.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"resource": {
|
||||
"aws_instance": {
|
||||
"db": {
|
||||
"vpc": "foo",
|
||||
"provisioner": [{
|
||||
"file": {
|
||||
"source": "foo",
|
||||
"destination": "bar"
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user