diff --git a/command/format/state.go b/command/format/state.go index 6b3bd378f3..68b5432dc6 100644 --- a/command/format/state.go +++ b/command/format/state.go @@ -59,7 +59,7 @@ func State(opts *StateOpts) string { if m.OutputValues != nil { if len(m.OutputValues) > 0 { - p.buf.WriteString("\nOutputs:\n\n") + p.buf.WriteString("Outputs:\n\n") } // Sort the outputs diff --git a/command/format/state_test.go b/command/format/state_test.go index 7da016cb63..3c946d37ad 100644 --- a/command/format/state_test.go +++ b/command/format/state_test.go @@ -61,7 +61,7 @@ func TestState(t *testing.T) { Color: disabledColorize, Schemas: testSchemas(), }, - "test_resource.baz", + TestOutput, }, } @@ -69,7 +69,7 @@ func TestState(t *testing.T) { got := State(tt.State) if got != tt.Want { t.Errorf( - "wrong result\ninput: %v\ngot: %s\nwant: %s", + "wrong result\ninput: %v\ngot: \n%s\nwant: \n%s", tt.State.State, got, tt.Want, ) } @@ -122,3 +122,13 @@ func testSchemas() *terraform.Schemas { }, } } + +const TestOutput = `# test_resource.baz[0]: +resource "test_resource" "baz" { + woozles = "confuzles" +} + + +Outputs: + +bar = "bar value"`