Browse Source

main: replace crlf on windows in fmt test

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
pull/48/head
Jason A. Donenfeld 1 year ago
parent
commit
9844c74f67
  1. 4
      format_test.go

4
format_test.go

@ -10,6 +10,7 @@ import (
"io/fs"
"os"
"path/filepath"
"runtime"
"sync"
"testing"
)
@ -32,6 +33,9 @@ func TestFormatting(t *testing.T) {
t.Errorf("unable to read %s: %v", path, err)
return
}
if runtime.GOOS == "windows" {
src = bytes.ReplaceAll(src, []byte{'\r', '\n'}, []byte{'\n'})
}
formatted, err := format.Source(src)
if err != nil {
t.Errorf("unable to format %s: %v", path, err)

Loading…
Cancel
Save