aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-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) {