Open agfn opened 2 years ago
can be fixed by the following patch:
--- a/src/helpers.ts
+++ b/src/helpers.ts
@@ -1,3 +1,4 @@
+import {normalize} from "path";
/**
* Finds the matching suffixes of the string, stripping off the non-matching starting characters.
@@ -28,7 +29,7 @@ export function findIntersect(base: string, comparee: string): string {
* @param fileName File name to remove OS specific features
*/
export function normalizeFileName(fileName: string): string {
- let name = fileName;
+ let name = normalize(fileName);
// make file path relative and OS independent
name = name.toLocaleLowerCase();
// remove all file slashes
@agfn Thanks for the ticket and the fix! This will go out in 2.9.0 and I will try to get a PR up today for you to review (the fix is pretty much what you added above but I am trying to add some test coverage to prevent regressions in the future).
@agfn I have a first try here at the fix you mentioned https://github.com/ryanluker/vscode-coverage-gutters/pull/352 there might be a bit of cleanup left over as normalizing the file name causes some other tests to fail 🤔.
The failing tests are just unit level ones though, so most likely just a simple cleanup 😁.
Describe the bug
When
sectionFileName
inlcov.info
file contains..
, functioncheckSectionAbsolute
(used to match coverage section and source file) does not work correctly.To Reproduce Steps to reproduce the behaviour:
lcov.info
contains the follow content:json-c/arraylist.c
file will be marked as "No Coverage". BecausecheckSectionAbsolute
only check suffix, andsectionFileName
is not simplified absolute path.Expected behaviour
Screenshots
Desktop (please complete the following information):
Additional context Add any other context about the problem here.