Fix invalid coverage computation when --output-format=json is enabled

This commit is contained in:
Guillaume Gomez
2024-11-04 14:28:35 +01:00
parent ca87b535a0
commit e9161db5b5
7 changed files with 14 additions and 6 deletions

View File

@@ -132,6 +132,7 @@ impl<'a, 'b> CoverageCalculator<'a, 'b> {
fn print_results(&self) {
let output_format = self.ctx.output_format;
// In this case we want to ensure that the `OutputFormat` is JSON and NOT the `DocContext`.
if output_format.is_json() {
println!("{}", self.to_json());
return;