aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2019-10-28 16:55:06 -0700
committerDmitri Shuralyov <dmitshur@golang.org>2020-03-31 23:07:15 +0000
commit5a31a971f32e390bd3664898c03b23f5b6a7c27d (patch)
tree2b9b2c0b6f2fb70ddfcac63cade5a550298fc5c4
parentf353662952b48af110dc878adfa533745e168716 (diff)
downloadgo-5a31a971f32e390bd3664898c03b23f5b6a7c27d.tar.gz
go-5a31a971f32e390bd3664898c03b23f5b6a7c27d.zip
[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 <bcmills@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit a754d2993db1771ca3903d0a5d0e3add1883cf9b) Reviewed-on: https://go-review.googlesource.com/c/go/+/223703 Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Andrew Bonventre <andybons@golang.org>
-rw-r--r--src/cmd/compile/internal/syntax/parser_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/syntax/parser_test.go b/src/cmd/compile/internal/syntax/parser_test.go
index 3cf55defc7..673339d667 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)
}
}