Skip to content

Commit

Permalink
Fix Illegal argument: line must be non-negative (#425)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Luker <ryanluker@outlook.com>
  • Loading branch information
sfc-gh-wzhao and ryanluker authored Sep 17, 2023
1 parent 23ac71a commit 0b76767
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/coverage-system/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class Renderer {
return;
}
section.lines.details
.filter((detail) => detail.line >= 0)
.filter((detail) => detail.line > 0)
.forEach((detail) => {
const lineRange = new Range(detail.line - 1, 0, detail.line - 1, 0);
if (detail.hit > 0) {
Expand All @@ -143,7 +143,7 @@ export class Renderer {
return;
}
section.branches.details
.filter((detail) => detail.taken === 0 && detail.line >= 0)
.filter((detail) => detail.taken === 0 && detail.line > 0)
.forEach((detail) => {
const partialRange = new Range(detail.line - 1, 0, detail.line - 1, 0);
// Evaluates to true if at least one element in range is equal to partialRange
Expand Down

0 comments on commit 0b76767

Please sign in to comment.