core: Fix TestContext2Plan_ignoreChangesWithFlatmaps
Prior to our v0.12 changes this test was confusingly using an attribute named "set", but assigning a map to it. The expected test result suggested that it was actually expecting legacy HCL2's weird interpretation of a single map as a list of maps, and so to retain the intent of the test here (in spite of the contrary name) we type "set" as list of map of string, update the fixture to _actually_ be a list of maps, and then we get the expected test result.
This commit is contained in:
parent
c6787d0266
commit
3f4b7f847d
|
@ -3821,8 +3821,13 @@ func TestContext2Plan_ignoreChangesWithFlatmaps(t *testing.T) {
|
|||
Attributes: map[string]*configschema.Attribute{
|
||||
"user_data": {Type: cty.String, Optional: true},
|
||||
"require_new": {Type: cty.String, Optional: true},
|
||||
"set": {Type: cty.Map(cty.String), Optional: true},
|
||||
"lst": {Type: cty.List(cty.String), Optional: true},
|
||||
|
||||
// This test predates the 0.12 work to integrate cty and
|
||||
// HCL, and so it was ported as-is where its expected
|
||||
// test output was clearly expecting a list of maps here
|
||||
// even though it is named "set".
|
||||
"set": {Type: cty.List(cty.Map(cty.String)), Optional: true},
|
||||
"lst": {Type: cty.List(cty.String), Optional: true},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -2,10 +2,10 @@ resource "aws_instance" "foo" {
|
|||
user_data = "x"
|
||||
require_new = "yes"
|
||||
|
||||
set = {
|
||||
set = [{
|
||||
a = "1"
|
||||
b = "2"
|
||||
}
|
||||
}]
|
||||
|
||||
lst = ["j", "k"]
|
||||
|
||||
|
|
Loading…
Reference in New Issue