From 1530e18a2c108305030f8326904ef8609589164c Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Sat, 10 Oct 2020 20:07:28 -0400 Subject: [PATCH] Remove extra newlines when no-summary=output --- testjson/summary.go | 4 +++- testjson/summary_test.go | 5 ----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/testjson/summary.go b/testjson/summary.go index 38f3be53..d351b37a 100644 --- a/testjson/summary.go +++ b/testjson/summary.go @@ -183,7 +183,9 @@ func writeTestCaseSummary(out io.Writer, execution executionSummary, conf testCa } fmt.Fprint(out, line) } - fmt.Fprintln(out) + if _, isNoOutput := execution.(*noOutputSummary); !isNoOutput { + fmt.Fprintln(out) + } } } diff --git a/testjson/summary_test.go b/testjson/summary_test.go index b51cf432..e3a08ffe 100644 --- a/testjson/summary_test.go +++ b/testjson/summary_test.go @@ -186,17 +186,12 @@ DONE 13 tests, 1 skipped, 4 failures, 1 error in 34.123s === Skipped === SKIP: project/pkg/more TestOnlySometimes (0.00s) - === Failed === FAIL: project/badmain (0.00s) - === FAIL: project/fs TestFileDo (1.41s) - === FAIL: project/fs TestFileDoError (0.01s) - === FAIL: project/pkg/more TestAlbatross (0.04s) - === Errors pkg/file.go:99:12: missing ',' before newline