diff --git a/tests/chinook_db_test.go b/tests/chinook_db_test.go index c6569cc..7b81a28 100644 --- a/tests/chinook_db_test.go +++ b/tests/chinook_db_test.go @@ -1,6 +1,7 @@ package tests import ( + "bytes" "context" "encoding/json" "fmt" @@ -9,6 +10,7 @@ import ( . "github.com/go-jet/jet/tests/.gentestdata/jetdb/chinook/table" "gotest.tools/assert" "io/ioutil" + "runtime" "testing" "time" ) @@ -346,6 +348,10 @@ func assertJsonFile(t *testing.T, jsonFilePath string, data interface{}) { fileJsonData, err := ioutil.ReadFile(jsonFilePath) assert.NilError(t, err) + if runtime.GOOS == "windows" { + fileJsonData = bytes.Replace(fileJsonData, []byte("\r\n"), []byte("\n"), -1) + } + jsonData, err := json.MarshalIndent(data, "", "\t") assert.NilError(t, err)