From 3968772673dadf6f84d9dd11ae2b5ec748aea4b9 Mon Sep 17 00:00:00 2001 From: Julien Kauffmann Date: Tue, 24 Jan 2017 09:09:02 -0500 Subject: [PATCH] Fixed tests not passing on Windows --- viper_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/viper_test.go b/viper_test.go index cd7b65c..6b9754a 100644 --- a/viper_test.go +++ b/viper_test.go @@ -11,8 +11,9 @@ import ( "io" "io/ioutil" "os" - "path" + path "path/filepath" "reflect" + "runtime" "sort" "strings" "testing" @@ -183,10 +184,16 @@ func initHcl() { func initDirs(t *testing.T) (string, string, func()) { var ( - testDirs = []string{`a a`, `b`, `c\c`, `D_`} + testDirs []string config = `improbable` ) + if runtime.GOOS == "windows" { + testDirs = []string{`a a`, `b`, `D_`} + } else { + testDirs = []string{`a a`, `b`, `c\c`, `D_`} + } + root, err := ioutil.TempDir("", "") cleanup := true