From 603baefff989777996bf283da430d693e78eba3a Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Wed, 20 Jun 2018 10:27:46 +0800 Subject: [PATCH] Fix path not found message on Windows (#227) --- cmd/tomljson/main_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/tomljson/main_test.go b/cmd/tomljson/main_test.go index 0b4bdbb..d515ee0 100644 --- a/cmd/tomljson/main_test.go +++ b/cmd/tomljson/main_test.go @@ -4,6 +4,7 @@ import ( "bytes" "io/ioutil" "os" + "runtime" "strings" "testing" ) @@ -76,7 +77,14 @@ func TestProcessMainReadFromFile(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) }