diff --git a/cli/tools/coverage/reporter.rs b/cli/tools/coverage/reporter.rs index 6547f2036d..f359755a92 100644 --- a/cli/tools/coverage/reporter.rs +++ b/cli/tools/coverage/reporter.rs @@ -633,7 +633,7 @@ impl HtmlCoverageReporter { ) -> String { let line_num = file_text.lines().count(); let line_count = (1..line_num + 1) - .map(|i| format!("{i}")) + .map(|i| format!("{i}")) .collect::>() .join("\n"); let line_coverage = (0..line_num) diff --git a/tests/integration/coverage_tests.rs b/tests/integration/coverage_tests.rs index 6e9a1454ca..ae732f25f3 100644 --- a/tests/integration/coverage_tests.rs +++ b/tests/integration/coverage_tests.rs @@ -486,6 +486,9 @@ fn test_html_reporter() { assert_contains!(bar_ts_html, "

Coverage report for bar.ts

"); // Check in source code is escaped to <T> assert_contains!(bar_ts_html, "<T>"); + // Check that line anchors are correctly referenced by line number links + assert_contains!(bar_ts_html, ""); + assert_contains!(bar_ts_html, "1"); let baz_index_html = tempdir .join("html")