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

go-test compilation error pattern doesn't match Go 1.14 output #362

Open
phst opened this issue May 10, 2020 · 2 comments · May be fixed by #363
Open

go-test compilation error pattern doesn't match Go 1.14 output #362

phst opened this issue May 10, 2020 · 2 comments · May be fixed by #363

Comments

@phst
Copy link
Contributor

phst commented May 10, 2020

The output of go test -v has changed somewhat in Go 1.14. For example, with this /tmp/f/foo_test.go:

package foo_test

import "testing"

func Test(t *testing.T) {
	t.Error(1)
}

the Go 1.13 output is

=== RUN   Test
--- FAIL: Test (0.00s)
    foo_test.go:6: 1
FAIL
exit status 1
FAIL	_/tmp/f	0.010s

but the Go 1.14 output is

=== RUN   Test
    Test: foo_test.go:6: 1
--- FAIL: Test (0.00s)
FAIL
exit status 1
FAIL	_/tmp/f	0.011s

Note that the error message now has the prefix Test: (i.e. test name, colon, space). This is probably related to the change described at https://golang.org/doc/go1.14#go-test. However, the go-test pattern treats the entire Test: foo_test.go part as filename.

go-test should be adapted accordingly.

phst added a commit to phst/go-mode.el that referenced this issue May 10, 2020
Fixes dominikh#361, dominikh#362

Restrict the prefix and filename pattern (Bug dominikh#361), and also allow for a test
name prefix (Bug dominikh#362).

Add regression tests for these bugs.
@phst phst linked a pull request May 10, 2020 that will close this issue
phst added a commit to phst/go-mode.el that referenced this issue May 10, 2020
Fixes dominikh#361, dominikh#362

Restrict the prefix and filename pattern (Bug dominikh#361), and also allow for a test
name prefix (Bug dominikh#362).

Add regression tests for these bugs.
@dominikh
Copy link
Owner

I cannot reproduce this with go1.18-8ff254e30b:

=== RUN   Test
    sand_test.go:6: 1
--- FAIL: Test (0.00s)
FAIL
exit status 1
FAIL	example.com/sand2	0.001s

@phst
Copy link
Contributor Author

phst commented Jan 1, 2022

Maybe this got fixed again by a change in Go 1.15 (https://go.dev/doc/go1.15#testing):

go test -v now groups output by test name, rather than printing the test name on each line.

It's probably still worth adding a unit test to ensure that Emacs correctly parses the test output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants