-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
testing: Helper line number has changed in 1.16 #44887
Comments
@gopherbot Please open backport to 1.16 In some cases |
Backport issue(s) opened: #44888 (for 1.16). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
I just ran into this problem. I have been using a function I notice this issue has been pushed out a couple patch releases. Please let me know if I can be of any help in restoring the old behaviour or testing a fix. Example use case: func runCase(t *testing.T, name string, fn func(t *testing.T)) {
t.Helper()
t.Run(name, func(t *testing.T) {
t.Helper()
t.Log("case:", name)
fn(t)
})
} |
parent's helperNames has not been set when frameSkip called, moving helperNames initilazing to frameSkip. Fixes golang#44887 Change-Id: I5107c5951033e5e47d1ac441eac3ba5344a7bdc0
Change https://golang.org/cl/302469 mentions this issue: |
parent's helperNames has not been set when frameSkip called, moving helperNames initilazing to frameSkip. Fixes golang#44887
parent's helperNames has not been set when frameSkip called, moving helperNames initilazing to frameSkip. Fixes golang#44887
parent's helperNames has not been set when frameSkip called, moving helperNames initilazing to frameSkip. Fixes golang#44887
parent's helperNames has not been set when frameSkip called, moving helperNames initilazing to frameSkip. Fixes golang#44887
Change https://golang.org/cl/303189 mentions this issue: |
…ing it parent's helperNames has not been set when frameSkip called, moving helperNames initilazing to frameSkip. For #44887 Fixes #44888 Change-Id: I5107c5951033e5e47d1ac441eac3ba5344a7bdc0 GitHub-Last-Rev: 44b90b2 GitHub-Pull-Request: #45071 Reviewed-on: https://go-review.googlesource.com/c/go/+/302469 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> (cherry picked from commit 6704843) Reviewed-on: https://go-review.googlesource.com/c/go/+/303189 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
This is the test program.
When run using
go test foo_test.go
with Go 1.14 or Go 1.15, this program printsWhen run with Go 1.16 it prints
The line number has changed from 8 to 14. Line number 14 is in a function that called
t.Helper
, so line 8 seems correct and line 14 seems wrong.This appears to be due to https://golang.org/cl/231717. If I revert that CL, I see line number 8.
CC @bboreham
The text was updated successfully, but these errors were encountered: