core: fix string rendering of modules in diffs

This was assuming our old practice of a slice starting with the string
"root". We'll normalize here and then stringify the result to ensure that
we get a string consistent with what's used elsewhere.

This is primarily aimed at fixing some of the context plan tests.
This commit is contained in:
Martin Atkins 2018-05-22 18:04:06 -07:00
parent 39dfc9f4e0
commit eb54715902
1 changed files with 2 additions and 1 deletions

View File

@ -185,7 +185,8 @@ func (d *Diff) String() string {
keys := make([]string, 0, len(d.Modules))
lookup := make(map[string]*ModuleDiff)
for _, m := range d.Modules {
key := fmt.Sprintf("module.%s", strings.Join(m.Path[1:], "."))
addr := normalizeModulePath(m.Path)
key := addr.String()
keys = append(keys, key)
lookup[key] = m
}