backport of commit 5f4ff0e8be

pull/26948/head
James Bardin 6 years ago
parent de1574d55f
commit 41acdc292e

@ -39,7 +39,7 @@ func (c *Changes) Empty() bool {
}
for _, out := range c.Outputs {
if out.Action != NoOp {
if out.Addr.Module.IsRoot() && out.Action != NoOp {
return false
}
}

@ -68,3 +68,28 @@ func TestProviderAddrs(t *testing.T) {
t.Error(problem)
}
}
// Module outputs should not effect the result of Empty
func TestModuleOutputChangesEmpty(t *testing.T) {
changes := &Changes{
Outputs: []*OutputChangeSrc{
{
Addr: addrs.AbsOutputValue{
Module: addrs.RootModuleInstance.Child("child", addrs.NoKey),
OutputValue: addrs.OutputValue{
Name: "output",
},
},
ChangeSrc: ChangeSrc{
Action: Update,
Before: []byte("a"),
After: []byte("b"),
},
},
},
}
if !changes.Empty() {
t.Fatal("plan has no visible changes")
}
}

Loading…
Cancel
Save