Skip to content

Commit f648212

Browse files
committed
fixed replacer in test for windows
1 parent 58602bf commit f648212

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cowsay_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"io/ioutil"
77
"os"
88
"path/filepath"
9+
"strings"
910
"testing"
1011

1112
"github.com/google/go-cmp/cmp"
@@ -222,8 +223,10 @@ func TestSay(t *testing.T) {
222223
if err != nil {
223224
t.Fatal(err)
224225
}
225-
want := string(content)
226+
got = strings.Replace(got, "\r", "", -1) // for windows
227+
want := strings.Replace(string(content), "\r", "", -1) // for windows
226228
if want != got {
229+
t.Log(cmp.Diff([]byte(want), []byte(got)))
227230
t.Fatalf("want\n%s\n\ngot\n%s", want, got)
228231
}
229232
})

0 commit comments

Comments
 (0)