Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: TestFileLineInErrorMessages may fail due to wrong assumption about file name in error message #11355

Closed
0x6a67 opened this issue Jun 23, 2015 · 2 comments
Milestone

Comments

@0x6a67
Copy link

0x6a67 commented Jun 23, 2015

Test looks for absolute file name, but go tool may rewrite it to shorter relative form.

For example test fails on Windows when
GOROOT=D:\opt\usr\src\go\jtip
TMP=D:\opt\usr\src\go\tmp

--- FAIL: TestFileLineInErrorMessages (0.36s)
    go_test.go:183: running testgo [run D:\opt\usr\src\go\tmp\gotest000670749\err.go]
    go_test.go:202: standard error:
    go_test.go:203: ..\..\..\..\tmp\gotest000670749\err.go:1:22: cannot find package "bar" in any of:
            D:\opt\usr\src\go\jtip\src\bar (from $GOROOT)
            ($GOPATH not set)

    go_test.go:222: testgo failed as expected: exit status 1
    go_test.go:264: missing file:line in error message
    go_test.go:265: pattern ^D:\\opt\\usr\\src\\go\\tmp\\gotest000670749\\err\.go: not found in standard error
FAIL
@0x6a67 0x6a67 changed the title cmd/go: TestFileLineInErrorMessages - wrong assumption about file name in error message cmd/go: TestFileLineInErrorMessages may fail due to wrong assumption about file name in error message Jun 23, 2015
@alexbrainman
Copy link
Member

@0x6a67 very nice issue description. Thank you. Here https://go-review.googlesource.com/11475 is the fix.

Alex

@gopherbot
Copy link

CL https://golang.org/cl/11475 mentions this issue.

@mikioh mikioh added this to the Go1.5 milestone Jun 27, 2015
@golang golang locked and limited conversation to collaborators Jun 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants