handle windows line endings

This commit is contained in:
Ajitem Sahasrabuddhe 2019-12-08 13:52:50 +05:30
parent 646677ae0b
commit 0ce33c3785

View File

@ -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)
}