diff options
author | Steve Moyer <smoyer1@selesy.com> | 2022-06-06 08:25:36 -0400 |
---|---|---|
committer | Steve Moyer <smoyer1@selesy.com> | 2022-06-06 08:25:36 -0400 |
commit | cd1099aac8cd2de0c3c47587a76da53df2c2f448 (patch) | |
tree | dce41a190c44aefc54e94b69308179ccf6ac1093 /commands/root_test.go | |
parent | eda312f9b1998f5c6d6881312091fd9451c2ffe3 (diff) | |
download | git-bug-cd1099aac8cd2de0c3c47587a76da53df2c2f448.tar.gz |
fix(808): replace Windows line terminators
Diffstat (limited to 'commands/root_test.go')
-rw-r--r-- | commands/root_test.go | 6 |
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) { |