]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/syntax: don't hardwire path separator in test
authorRobert Griesemer <gri@golang.org>
Mon, 28 Oct 2019 23:55:06 +0000 (16:55 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 29 Oct 2019 03:53:40 +0000 (03:53 +0000)
Windows uses '\' not '/'.

Fixes #35175.

Change-Id: Ib3d01dcf148fc0675496d5213f5bcc9cf210a6fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/203889
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

src/cmd/compile/internal/syntax/parser_test.go

index 3cf55defc774dc2147d2b665343c8456866e8c95..673339d667c18075d9dafbcade05e2c2b506853e 100644 (file)
@@ -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)
                        }
                }