core: Fix test for NodeDestroyResource.DynamicExpand

Provider addresses are now required for ResourceState, and the string
formatting is now different in the naming of destroy-deposed graph nodes.
This commit is contained in:
Martin Atkins 2018-05-10 16:07:01 -07:00
parent 26e820d829
commit ce41553d56

View File

@ -22,6 +22,7 @@ func TestNodeDestroyResourceDynamicExpand_deposedCount(t *testing.T) {
ID: "foo",
},
},
Provider: "provider.aws",
},
"aws_instance.bar.1": &ResourceState{
Type: "aws_instance",
@ -30,6 +31,7 @@ func TestNodeDestroyResourceDynamicExpand_deposedCount(t *testing.T) {
ID: "bar",
},
},
Provider: "provider.aws",
},
},
},
@ -59,11 +61,11 @@ func TestNodeDestroyResourceDynamicExpand_deposedCount(t *testing.T) {
t.Fatalf("err: %s", err)
}
actual := strings.TrimSpace(g.String())
expected := strings.TrimSpace(`
aws_instance.bar.0 (deposed #0)
got := strings.TrimSpace(g.String())
want := strings.TrimSpace(`
aws_instance.bar[0] (deposed #0)
`)
if actual != expected {
t.Fatalf("bad:\n\n%s", actual)
if got != want {
t.Fatalf("wrong result\n\ngot:\n%s\n\nwant:\n%s", got, want)
}
}