You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
diff-coverage: ignore counts inside a string or comment prose, unlike mutant: equivalent #33
A line whose only diff-coverage: ignore sits in a string literal, or after a * in the prose of a comment, leaves the diff-coverage report as acknowledged. For example, both of these lines drop out of the uncovered list:
Stringhint = "// diff-coverage: ignore -- why";
x(); y(); // a * diff-coverage: ignore here
DiffCoverageReport.IGNORE_MARKER matches (?://|/\*|\*)\s*diff-coverage:\s*ignore on the raw text of the line, and its Javadoc states that a marker inside a string counts as well (DiffCoverageReport.java:36-41). #31 reads mutant: equivalent markers by different rules: one counts only where a // or /* opens a comment or lies in a line comment, or where a run of * leads a line inside a block comment, as SourceFileKey.tokens lexes the file. So the two markers disagree on the same line.
Expected: one rule for both markers. Applying the #31 rule to diff-coverage: ignore changes the shipped behavior of an existing marker, since a line acknowledged only by a marker in a string would count as uncovered again. The decision this needs is whether that change is wanted, and in which release.
Related: #32 (whether diff-coverage: ignore should also cover the mutants of its line).
Activity