core: Fix TestContext2Apply_countDecreaseToOneCorrupted

We now include attribute changes in destroy diffs, so the expected output
of this test includes these changes.

Also includes a fix to legacyDiffComparisonString to actually sort the
attribute changes by name in the rendered diff.
This commit is contained in:
Martin Atkins 2018-09-25 16:15:49 -07:00
parent 74ffebe8ea
commit ca6efc6ba9
2 changed files with 3 additions and 0 deletions

View File

@ -945,6 +945,7 @@ func legacyDiffComparisonString(changes *plans.Changes) string {
keyLen = len(n)
}
}
sort.Strings(attrNamesOrder)
for _, attrK := range attrNamesOrder {
v := newAttrs[attrK]

View File

@ -474,6 +474,8 @@ const testTerraformApplyCountDecToOneCorruptedPlanStr = `
DIFF:
DESTROY: aws_instance.foo[0]
id: "baz" => ""
type: "aws_instance" => ""