Repository navigation
Conversation
Proper merging of a file which is only available on one of the two merged resultset
|
possibly related #501 (comment) |
|
Actually there's one more issue with merging. It's quite common that you have:
SimpleCov for file that is only loaded, but not executed prefills coverage with zero's. The Given above. Proper result for this is: |
|
@ayufan % git rev-parse @
a80baea9eb97772eeeec339d379887368969c91c
% bundle exec irb -rsimplecov
irb(main):001:0> [1,nil,nil].extend(SimpleCov::ArrayMergeHelper).merge_resultset([0,0,0])
=> [1, nil, nil] (size=3)
irb(main):002:0> [0,0,0].extend(SimpleCov::ArrayMergeHelper).merge_resultset([1,nil,nil])
=> [1, nil, nil] (size=3) |
|
Awesome! |
|
Working on a new release now! |
|
@thedrow Yes, I believe so. Please reopen it if this issue reappears. |
In merging two resultsets, if a file only appears in only one of the resultsets, the current merger implementation generates incorrect resultset.
{file => [nil, 0, 1]}and{}results in{file => [nil, 0, 1]}(ok){}and{file => [nil, 0, 1]}results in{file => [nil, nil, 1]}(0 is lost)This patch fixes the problem.