-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.help wanted
Milestone
Description
Run coverage on the following program using these commands:
$ cd $GOROOT/src/test
$ cat test.go
package test
func f() {
if true {
println("A")
}
// comment
if true {
// comment
if false {
println("B")
}
} else {
// comment
println("D")
}
}
$ cat test_test.go
package test
import "testing"
func Test(t *testing.T) { f() }
$ go test -coverprofile=c.out test
ok test 0.015s coverage: 66.7% of statements
$ command go tool cover -html=c.out
This is the rendered HTML output:
Observe that the first comment is grey, not green, even though it was covered. Is this a simple bookkeeping error, or is there a design reason why we shouldn't consider the entire span from func f() { up to if false as covered, and render it green?
(This is Google internal issue 68650370.)
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.help wanted
