From f5df8faf8b6a328107fc5142a7ef36dae28fdeb5 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 1 Jul 2019 20:56:00 -0400 Subject: [PATCH] fix: Fixing tests on windows --- chglog_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/chglog_test.go b/chglog_test.go index b233b45d..09891d3f 100644 --- a/chglog_test.go +++ b/chglog_test.go @@ -252,6 +252,7 @@ change message.`) buf := &bytes.Buffer{} err := gen.Generate(buf, "") + output := strings.Replace(strings.TrimSpace(buf.String()), "\r\n", "\n", -1) assert.Nil(err) assert.Equal(` @@ -297,7 +298,7 @@ Online breaking change message. [Unreleased]: https://github.com/git-chglog/git-chglog/compare/2.0.0-beta.0...HEAD [2.0.0-beta.0]: https://github.com/git-chglog/git-chglog/compare/1.1.0...2.0.0-beta.0 -[1.1.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...1.1.0`, strings.TrimSpace(buf.String())) +[1.1.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...1.1.0`, output) } func TestGeneratorWithNextTag(t *testing.T) { @@ -346,6 +347,7 @@ func TestGeneratorWithNextTag(t *testing.T) { buf := &bytes.Buffer{} err := gen.Generate(buf, "") + output := strings.Replace(strings.TrimSpace(buf.String()), "\r\n", "\n", -1) assert.Nil(err) assert.Equal(` @@ -372,10 +374,11 @@ func TestGeneratorWithNextTag(t *testing.T) { [Unreleased]: https://github.com/git-chglog/git-chglog/compare/3.0.0...HEAD [3.0.0]: https://github.com/git-chglog/git-chglog/compare/2.0.0...3.0.0 -[2.0.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...2.0.0`, strings.TrimSpace(buf.String())) +[2.0.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...2.0.0`, output) buf = &bytes.Buffer{} err = gen.Generate(buf, "3.0.0") + output = strings.Replace(strings.TrimSpace(buf.String()), "\r\n", "\n", -1) assert.Nil(err) assert.Equal(` @@ -389,5 +392,5 @@ func TestGeneratorWithNextTag(t *testing.T) { [Unreleased]: https://github.com/git-chglog/git-chglog/compare/3.0.0...HEAD -[3.0.0]: https://github.com/git-chglog/git-chglog/compare/2.0.0...3.0.0`, strings.TrimSpace(buf.String())) +[3.0.0]: https://github.com/git-chglog/git-chglog/compare/2.0.0...3.0.0`, output) }