From 9132cd04c31cb1fa7441daf12e5b1593fecb26ce Mon Sep 17 00:00:00 2001 From: Jason DeBettencourt Date: Sat, 27 Feb 2021 18:57:14 -0500 Subject: [PATCH] Translate line endings for test reference output (*nix -> windows), as git changes by default to windows --- all_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/all_test.go b/all_test.go index 64abb77..3c15858 100644 --- a/all_test.go +++ b/all_test.go @@ -565,6 +565,14 @@ func TestConcurrentProcesses(t *testing.T) { t.Fatal(err) } + if runtime.GOOS == "windows" { + // reference tests are in *nix format -- + // but git on windows does line-ending xlation by default + // if someone has it 'off' this has no impact. + // '\r\n' --> '\n' + b = bytes.ReplaceAll(b, []byte("\r\n"), []byte("\n")) + } + if err := ioutil.WriteFile(filepath.Join(dir, filepath.Base(v)), b, 0666); err != nil { t.Fatal(err) }