terraform: fix graph test
This commit is contained in:
parent
17821f2b00
commit
7a2591190b
|
@ -440,7 +440,11 @@ func graphAddDiff(g *depgraph.Graph, d *Diff) error {
|
||||||
i--
|
i--
|
||||||
|
|
||||||
case *GraphNodeResourceProvider:
|
case *GraphNodeResourceProvider:
|
||||||
// Keep these around
|
// Keep these around, but fix up the source to be ourselves
|
||||||
|
// rather than the old node.
|
||||||
|
newDep := *dep
|
||||||
|
newDep.Source = n
|
||||||
|
deps[i] = &newDep
|
||||||
default:
|
default:
|
||||||
panic(fmt.Errorf("Unhandled depedency type: %#v", dep.Meta))
|
panic(fmt.Errorf("Unhandled depedency type: %#v", dep.Meta))
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,7 +334,7 @@ func TestGraphAddDiff_destroy(t *testing.T) {
|
||||||
actual := strings.TrimSpace(g.String())
|
actual := strings.TrimSpace(g.String())
|
||||||
expected := strings.TrimSpace(testTerraformGraphDiffDestroyStr)
|
expected := strings.TrimSpace(testTerraformGraphDiffDestroyStr)
|
||||||
if actual != expected {
|
if actual != expected {
|
||||||
t.Fatalf("bad:\n\n%s", actual)
|
t.Fatalf("bad:\n\n%s\n\nexpected:\n\n%s", actual, expected)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify that the state has been added
|
// Verify that the state has been added
|
||||||
|
|
Loading…
Reference in New Issue