From 949bb6d816607cf4675f6607efbb48251a9551d1 Mon Sep 17 00:00:00 2001 From: kkawahar Date: Tue, 23 Mar 2021 00:10:24 +0900 Subject: [PATCH] fix: broken line breaks (#67) --- buildlog/buildlog.go | 2 +- buildlog/buildlog_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildlog/buildlog.go b/buildlog/buildlog.go index d3b3424..fa71b26 100644 --- a/buildlog/buildlog.go +++ b/buildlog/buildlog.go @@ -131,7 +131,7 @@ func (l *log) output(reader *bufio.Reader) (bool, error) { return false, &parseError{} } - fmt.Fprintln(l.writer, parsedLog) + fmt.Fprintf(l.writer, "%s\r\n", parsedLog) return false, nil } diff --git a/buildlog/buildlog_test.go b/buildlog/buildlog_test.go index 1a60bd2..f803ce9 100644 --- a/buildlog/buildlog_test.go +++ b/buildlog/buildlog_test.go @@ -75,7 +75,7 @@ func TestRun(t *testing.T) { select { case <-done: - expected := "main: test 1\nmain: test 2\n" + expected := "main: test 1\r\nmain: test 2\r\n" assert.Equal(t, expected, writer.String()) case <-timeout: assert.Fail(t, "timeout stop buildlog") @@ -121,7 +121,7 @@ func TestRun(t *testing.T) { select { case <-done: - expected := "main: test 1\nmain: long input " + string(longBuffer) + "\nmain: test 3\n" + expected := "main: test 1\r\nmain: long input " + string(longBuffer) + "\r\nmain: test 3\r\n" assert.Equal(t, expected, writer.String()) case <-timeout: assert.Fail(t, "timeout stop buildlog")