Fix path not found message on Windows (#227)

This commit is contained in:
Yang Luo
2018-06-20 10:27:46 +08:00
committed by Thomas Pelletier
parent c01d1270ff
commit 603baefff9
+9 -1
View File
@@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"io/ioutil" "io/ioutil"
"os" "os"
"runtime"
"strings" "strings"
"testing" "testing"
) )
@@ -76,7 +77,14 @@ func TestProcessMainReadFromFile(t *testing.T) {
} }
func TestProcessMainReadFromMissingFile(t *testing.T) { func TestProcessMainReadFromMissingFile(t *testing.T) {
expectedError := `open /this/file/does/not/exist: no such file or directory var expectedError string
if runtime.GOOS == "windows" {
expectedError = `open /this/file/does/not/exist: The system cannot find the path specified.
` `
} else {
expectedError = `open /this/file/does/not/exist: no such file or directory
`
}
expectProcessMainResults(t, ``, []string{"/this/file/does/not/exist"}, -1, ``, expectedError) expectProcessMainResults(t, ``, []string{"/this/file/does/not/exist"}, -1, ``, expectedError)
} }