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:
parent
e2e2ea401a
commit
864e892e2a
1 changed files with 7 additions and 0 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue