mirror of
https://github.com/unclebob/crapper.git
synced 2026-11-26 18:18:49 +00:00
A region was only (start line, count), so a span of lines 4-5 with count 1 never marked line 5 covered. Regions are now (start_line, end_line, count). SwiftFile.line_covered(line) is true when the innermost region containing that line has a count above zero, so a nested zero-count region leaves its lines uncovered. A segment is still one line. CRAP still counts each region once, when its start line lies in the function. Proved by the span, innermost-region, segment, xccov, and CRAP snapshot tests. The choose fixture stays at 50% coverage and CRAP 2.5. Co-authored-by: Robert C. Martin <[email protected]>