terraform: fix graph test

This commit is contained in:
Mitchell Hashimoto 2014-09-17 17:52:24 -07:00
parent 17821f2b00
commit 7a2591190b
2 changed files with 6 additions and 2 deletions

View File

@ -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))
} }

View File

@ -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