Skip to content

Commit

Permalink
fix(cobertura): removes rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
VannaDii committed Dec 8, 2023
1 parent aa66640 commit e6b3fe4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 4 additions & 0 deletions cobertura/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.4

- Removes rounding

## 1.0.3

- Adds to `show`
Expand Down
7 changes: 3 additions & 4 deletions cobertura/bin/src/cobertura.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,14 @@ void _writeCobertura({
}) {
var lineHits = results.records.fold<int>(0, (p, c) => p + c.lines.hit);
var lineFinds = results.records.fold<int>(0, (p, c) => p + c.lines.found);
var lineRate = lineFinds > 0 ? (lineHits / lineFinds).round() : lineFinds;
var lineRate = lineFinds > 0 ? (lineHits / lineFinds) : lineFinds;

var branchHits = results.records.fold<int>(0, (p, c) => p + c.branches.hit);
var branchFinds =
results.records.fold<int>(0, (p, c) => p + c.branches.found);
var branchRate =
branchFinds > 0 ? (branchHits / branchFinds).round() : branchFinds;
var branchRate = branchFinds > 0 ? (branchHits / branchFinds) : branchFinds;

var epochTimeStamp = (DateTime.now().millisecondsSinceEpoch / 1000).round();
var epochTimeStamp = (DateTime.now().millisecondsSinceEpoch / 1000);

var builder = xml.XmlBuilder();
builder
Expand Down
6 changes: 3 additions & 3 deletions cobertura/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cobertura
description: Converts LCOV to Cobertura format; the ideal format for GitHub and Azure DevOps.
version: 1.0.3
version: 1.0.4
homepage: https://pub-dev.dicatania.me/cobertura/
repository: https://github.com/VannaDi/pub-dev
issue_tracker: https://github.com/VannaDi/pub-dev/issues
Expand All @@ -12,8 +12,8 @@ executables:
cobertura:

dependencies:
xml: ^6.4.2
path: ^1.8.3
xml: ^6.5.0
path: ^1.9.0
args: ^2.4.2
yaml: ^3.1.2
tint: ^2.0.1
Expand Down

0 comments on commit e6b3fe4

Please sign in to comment.