From 5a31a971f32e390bd3664898c03b23f5b6a7c27d Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 28 Oct 2019 16:55:06 -0700 Subject: [PATCH] [release-branch.go1.13] cmd/compile/internal/syntax: don't hardwire path separator in test Windows uses '\' not '/'. For #35175. Fixes #37901. Change-Id: Ib3d01dcf148fc0675496d5213f5bcc9cf210a6fc Reviewed-on: https://go-review.googlesource.com/c/go/+/203889 Reviewed-by: Bryan C. Mills Run-TryBot: Brad Fitzpatrick (cherry picked from commit a754d2993db1771ca3903d0a5d0e3add1883cf9b) Reviewed-on: https://go-review.googlesource.com/c/go/+/223703 Reviewed-by: Robert Griesemer Run-TryBot: Andrew Bonventre --- src/cmd/compile/internal/syntax/parser_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/syntax/parser_test.go b/src/cmd/compile/internal/syntax/parser_test.go index 3cf55defc774dc..673339d667c180 100644 --- a/src/cmd/compile/internal/syntax/parser_test.go +++ b/src/cmd/compile/internal/syntax/parser_test.go @@ -96,7 +96,7 @@ func walkDirs(t *testing.T, dir string, action func(string)) { } } else if fi.IsDir() && fi.Name() != "testdata" { path := filepath.Join(dir, fi.Name()) - if !strings.HasSuffix(path, "/test") { + if !strings.HasSuffix(path, string(filepath.Separator)+"test") { dirs = append(dirs, path) } }