Fix tests on windows.
This commit is contained in:
parent
c97c6d1da4
commit
d253a35161
1 changed files with 6 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue