helper/resource: Fix import test harness, which was modifying state

Maps are reference types, it turns out :D
This commit is contained in:
Paul Hinze 2016-07-15 13:15:47 -06:00
parent 93832527b1
commit 614806d59f
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
1 changed files with 8 additions and 2 deletions

View File

@ -90,8 +90,14 @@ func testStepImportState(
}
// Compare their attributes
actual := r.Primary.Attributes
expected := oldR.Primary.Attributes
actual := make(map[string]string)
for k, v := range r.Primary.Attributes {
actual[k] = v
}
expected := make(map[string]string)
for k, v := range oldR.Primary.Attributes {
expected[k] = v
}
// Remove fields we're ignoring
for _, v := range step.ImportStateVerifyIgnore {