aboutsummaryrefslogtreecommitdiffstats
path: root/commands/root_test.go
diff options
context:
space:
mode:
authorSteve Moyer <smoyer1@selesy.com>2022-06-06 08:25:36 -0400
committerSteve Moyer <smoyer1@selesy.com>2022-06-06 08:25:36 -0400
commitcd1099aac8cd2de0c3c47587a76da53df2c2f448 (patch)
treedce41a190c44aefc54e94b69308179ccf6ac1093 /commands/root_test.go
parenteda312f9b1998f5c6d6881312091fd9451c2ffe3 (diff)
downloadgit-bug-cd1099aac8cd2de0c3c47587a76da53df2c2f448.tar.gz
fix(808): replace Windows line terminators
Diffstat (limited to 'commands/root_test.go')
-rw-r--r--commands/root_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/commands/root_test.go b/commands/root_test.go
index 5e780ec7..5f5a8876 100644
--- a/commands/root_test.go
+++ b/commands/root_test.go
@@ -7,6 +7,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
+ "strings"
"testing"
"github.com/MichaelMure/git-bug/commands"
@@ -63,6 +64,9 @@ func (e *testEnv) Execute(t *testing.T) {
func requireGoldenFileEqual(t *testing.T, path string, act []byte) {
t.Helper()
+ // Replace Windows line terminators
+ act = []byte(strings.ReplaceAll(string(act), "\r\n", "\n"))
+
path = filepath.Join("testdata", path)
if *update {
@@ -71,7 +75,7 @@ func requireGoldenFileEqual(t *testing.T, path string, act []byte) {
exp, err := ioutil.ReadFile(path)
require.NoError(t, err)
- require.Equal(t, exp, act)
+ require.Equal(t, string(exp), string(act))
}
func TestNewRootCommand(t *testing.T) {