errors/fmt: fix tests that assume GOPATH layout

LUCI doesn't check the source out into a GOPATH-style layout like
trybots do. Fix the tests that relied on that.

Change-Id: I6ebaf1dce5cf831c63743f64acee332dacb7f102
Reviewed-on: https://go-review.googlesource.com/c/exp/+/506297
Run-TryBot: Heschi Kreinick <heschi@google.com>
Auto-Submit: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Heschi Kreinick 2023-06-26 15:19:02 -04:00 коммит произвёл Gopher Robot
Родитель 2e198f4a06
Коммит c6a51d5fd9
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -141,7 +141,7 @@ func TestErrorFormatter(t *testing.T) {
fmt: "%+v",
want: "something:" +
"\n golang.org/x/exp/errors/fmt_test.TestErrorFormatter" +
"\n .+/golang.org/x/exp/errors/fmt/errors_test.go:98" +
"\n .+/fmt/errors_test.go:98" +
"\n something more",
regexp: true,
}, {

Просмотреть файл

@ -40,8 +40,8 @@ func Example_formatting() {
}
func stripPath(s string) string {
rePath := regexp.MustCompile(`( [^ ]*)golang.org`)
s = rePath.ReplaceAllString(s, " golang.org")
rePath := regexp.MustCompile(`( [^ ]*)/fmt`)
s = rePath.ReplaceAllString(s, " golang.org/x/exp/errors/fmt")
s = filepath.ToSlash(s)
return s
}