-
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: coverage calculation is wrong when runtime error occurs #62258
Comments
Can you include the code for parsecover.go? Which command are you running to retrieve coverage data? |
The code posted above is parsecover.go. |
Since coverage calculation is block-based, it assumes that all statements in a (branch-free) block will be executed. Without making the generated coverage code more fine-grained and inefficient, this would be hard to fix. It is an unusual enough case that it doesn't seem worth fixing. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
YES
What operating system and processor architecture are you using (
go env
)?What did you do?
Here is the code to reproduce the issue.
What did you expect to see?
Lines below "fmt.Println(n.next.data)" will be excluded from the coverage.
What did you see instead?
parsecover.go:146: divideByZero 100.0%
The text was updated successfully, but these errors were encountered: