1
0
mirror of https://github.com/golang/go synced 2024-10-01 20:18:33 -06:00
Commit Graph

5 Commits

Author SHA1 Message Date
Rob Pike
53f3b29c5d cmd/cover: fix race in test
Silly test added yesterday requires that some code in a goroutine executes.
Make sure it does.

Change-Id: I7e852454736e300151473986cc437a70b41dc9b7
Reviewed-on: https://go-review.googlesource.com/7691
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-17 21:45:36 +00:00
Rob Pike
26365e4e90 cmd/cover: fix handling of empty type switch
Just missed a case (ha!) in the tree walk. Dup the code for an empty switch, add test.

Fixes #10163.

Change-Id: I3d50ab6cb450ca21e87213291eaab8cbe924fac5
Reviewed-on: https://go-review.googlesource.com/7641
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-16 22:10:38 +00:00
Rob Pike
e4256a40f4 go.tools/cmd/cover: for range loops might contain function literals
Break the basic block at the function literal. The code to do this analysis
was already there; this CL just factors it out more nicely and uses it in
one new place. Also adds a test.

Fixes golang/go#6555.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/14601043
2013-10-11 10:32:36 -07:00
Rob Pike
1c382c95b2 go.tools/cmd/cover: get cover counters on if conditions
This requires a little more tree rewriting to put a block around the if of an "else if".
More tests too.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/11042045
2013-07-10 15:20:52 +10:00
Rob Pike
c28528d489 go.tools/cmd/cover: add a test
Test the statistics work as expected for a simple program, which can be extended as needed. This is all a bit meta.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/10392050
2013-06-21 14:35:09 -07:00