~shabbyrobe/gocovmerge

af8dc8edf8ee87c9add7aa0ed1941c88a52a0fea — Wade Simmons 8 years ago 1ef98db
don't increment Count, merge it

We don't want to increment the count, it should just be set to `1` if the
code was covered, and `0` if it wasn't. This can be accomplished by
a simple bitwise OR of the values so that if any coverage file has it
set to 1, the result will be 1.

Fixes #1
1 files changed, 1 insertions(+), 1 deletions(-)

M gocovmerge.go
M gocovmerge.go => gocovmerge.go +1 -1
@@ 41,7 41,7 @@ func mergeProfileBlock(p *cover.Profile, pb cover.ProfileBlock, startIndex int) 
		if p.Blocks[i].EndLine != pb.EndLine || p.Blocks[i].EndCol != pb.EndCol {
			log.Fatalf("OVERLAP MERGE: %v %v %v", p.FileName, p.Blocks[i], pb)
		}
		p.Blocks[i].Count += pb.Count
		p.Blocks[i].Count |= pb.Count
		combined++
	} else {
		if i > 0 {