From 0ce33c37854fbca7a36df49bd4dca25ff6ca9124 Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Sun, 8 Dec 2019 13:52:50 +0530 Subject: [PATCH] handle windows line endings --- docs_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs_test.go b/docs_test.go index e52cf8b..cea34ae 100644 --- a/docs_test.go +++ b/docs_test.go @@ -1,6 +1,7 @@ package cli import ( + "bytes" "io/ioutil" "testing" ) @@ -73,6 +74,8 @@ func testApp() *App { func expectFileContent(t *testing.T, file, expected string) { data, err := ioutil.ReadFile(file) + // Ignore windows line endings + expected = string(bytes.ReplaceAll([]byte(expected), []byte("\r\n"), []byte("\n"))) expect(t, err, nil) expect(t, string(data), expected) }