grodowski / undercover

undercover warns about methods, classes and blocks that were changed without tests, to help you easily find untested code and reduce the number of bugs. It does so by analysing data from git diffs, code structure and SimpleCov coverage reports
https://undercover-ci.com
MIT License
724 stars 28 forks source link

One-line update is not being recognized #204

Closed lizhangyuh closed 10 months ago

lizhangyuh commented 11 months ago

https://github.com/grodowski/undercover/blob/a5a26c19689f531a2e562042101f4e1d9427bd40/lib/undercover/result.rb#L16

I came across an issue where, if I update just one line block in a file, the first_line and last_line of the Result are the same, and the @coverage becomes an empty array.

Is this intentional? If so, could you please explain the reasoning behind it? Thanks!

grodowski commented 11 months ago

Hi @lizhangyuh! Thank you for submitting the issue. Looks wrong and thus I'll try to reproduce in a test case and fix. If you'd be keen to submit a PR that would be great too.

lizhangyuh commented 11 months ago

Hi @lizhangyuh! Thank you for submitting the issue. Looks wrong and thus I'll try to reproduce in a test case and fix. If you'd be keen to submit a PR that would be great too.

Thanks for your reply. I will submit a PR for this.