1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Windows: Fix dockerfile\parser unit test

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2015-11-01 20:08:37 -08:00
parent e2e2ea401a
commit 864e892e2a

View file

@ -1,10 +1,12 @@
package parser
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"runtime"
"testing"
)
@ -66,6 +68,11 @@ func TestTestData(t *testing.T) {
t.Fatalf("Error reading %s's result file: %v", dir, err)
}
if runtime.GOOS == "windows" {
// CRLF --> CR to match Unix behaviour
content = bytes.Replace(content, []byte{'\x0d', '\x0a'}, []byte{'\x0a'}, -1)
}
if ast.Dump()+"\n" != string(content) {
fmt.Fprintln(os.Stderr, "Result:\n"+ast.Dump())
fmt.Fprintln(os.Stderr, "Expected:\n"+string(content))