go/analysis/unitchecker: allow dash in file paths

The temporary directory may contain a dash, and the test shouldn't
fail because of that.

Fixes golang/go#31164

Change-Id: I3c0d636771e13fec345e46394fb548e3c4ea4478
Reviewed-on: https://go-review.googlesource.com/c/tools/+/170177
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Dmitri Shuralyov 2019-03-30 12:18:02 -04:00
parent a68386b9ff
commit aef51cc377
1 changed files with 4 additions and 4 deletions

View File

@ -78,18 +78,18 @@ func MyFunc123() {}
defer exported.Cleanup()
const wantA = `# golang.org/fake/a
([/._a-zA-Z0-9]+[\\/]fake[\\/])?a/a.go:4:11: call of MyFunc123\(...\)
([/._\-a-zA-Z0-9]+[\\/]fake[\\/])?a/a.go:4:11: call of MyFunc123\(...\)
`
const wantB = `# golang.org/fake/b
([/._a-zA-Z0-9]+[\\/]fake[\\/])?b/b.go:6:13: call of MyFunc123\(...\)
([/._a-zA-Z0-9]+[\\/]fake[\\/])?b/b.go:7:11: call of MyFunc123\(...\)
([/._\-a-zA-Z0-9]+[\\/]fake[\\/])?b/b.go:6:13: call of MyFunc123\(...\)
([/._\-a-zA-Z0-9]+[\\/]fake[\\/])?b/b.go:7:11: call of MyFunc123\(...\)
`
const wantAJSON = `# golang.org/fake/a
\{
"golang.org/fake/a": \{
"findcall": \[
\{
"posn": "([/._a-zA-Z0-9]+[\\/]fake[\\/])?a/a.go:4:11",
"posn": "([/._\-a-zA-Z0-9]+[\\/]fake[\\/])?a/a.go:4:11",
"message": "call of MyFunc123\(...\)"
\}
\]