command: fix test failure on Windows

URLs are `/`-based. Windows path Separator is `\`.
Convert `\` in test fixture path to `/` with filepath.ToSlash
such that proper URLs are constructed even on Windows.

Fixes a test failure on Windows.
This commit is contained in:
Emil Hessman 2015-01-28 06:39:16 +01:00
parent 92e68c1ee6
commit b40c2fe997
1 changed files with 1 additions and 1 deletions

View File

@ -1142,7 +1142,7 @@ func testHttpServer(t *testing.T) net.Listener {
func testHttpHandlerHeader(w http.ResponseWriter, r *http.Request) {
var url url.URL
url.Scheme = "file"
url.Path = testFixturePath("init")
url.Path = filepath.ToSlash(testFixturePath("init"))
w.Header().Add("X-Terraform-Get", url.String())
w.WriteHeader(200)