llvm-cov region[5] indexes that function's filenames, not unit["files"].
On Apple LLVM 21 those orders differ, so the span covering Place.swift line 5
was stored on test_entry_point.swift and the return stayed uncovered.
Proved by tests/fixtures/swift/function-filenames.json, which failed before
the fix (Place.swift received (1, 1, 1) instead of (4, 5, 1)). 226 pytest
tests passed. crapper worst CRAP on coverage.py is 9.0. dryer found no
candidates at 0.8 in coverage.py. mutator on coverage.py: 237 killed,
0 survived, 0 uncovered.
Co-authored-by: Robert C. Martin <[email protected]>
The Swift fixes left the changed files with 33 survivors. Tests now
distinguish an empty suffix, an equal path, a segment that starts on the
function's last line, the shorter extra prefix, an equal report key that
blocks a longer file, a blank candidate, a repeated source, form-html keys,
a short llvm-cov segment, a Swift export that has a profile but no binary,
and the quiet success paths for Java, Go, Rust, Python, Vitest, rustup,
and a custom coverage command.
Proved by mutator on runners.py and coverage.py: 432 killed, 0 survived,
0 uncovered.
Co-authored-by: Robert C. Martin <[email protected]>
A path in a built-in coverage command is one argument, a failed custom coverage command does not read a stale report, and git failures exit with git's status. The Clojure reader honors discards, metadata, and character literals. Long functions are split so every score is under 10 except the option switch.