Skip to content

Fixed Bug where last file in the lcov parse would not get added to the list. - #2

Open
arjungandhi wants to merge 1 commit into
sguiheux:masterfrom
Pattern-Labs:master
Open

Fixed Bug where last file in the lcov parse would not get added to the list. #2
arjungandhi wants to merge 1 commit into
sguiheux:masterfrom
Pattern-Labs:master

Conversation

@arjungandhi

@arjungandhi arjungandhi commented Jan 19, 2024

Copy link
Copy Markdown

Noticed this bug while working with the library. I've added a test case and fixed the issue

@arjungandhi

Copy link
Copy Markdown
Author

@sguiheux tagging ya so you can see this let me know if you need any more changes!

Comment thread coverage.go
Comment on lines +142 to +143
// Add last file
report.Files = append(report.Files, fileReport)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it would be unusual, I suspect it is technically legal to have an lcov file with no files listed. If that is the case this should probably be:

                         if fileReport.Path != "" {
				report.Files = append(report.Files, fileReport)
			}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants