-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
section could not be matched when sectionFileName="/xxx/../xx"
#351
Labels
Comments
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). |
ryanluker
added a commit
that referenced
this issue
Dec 5, 2021
Co-authored-by: ryanluker <[email protected]> Co-authored-by: agfn <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: