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:
Родитель
2e198f4a06
Коммит
c6a51d5fd9
|
@ -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
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче