-
Notifications
You must be signed in to change notification settings - Fork 115
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
Missed coverage of function in a list. #556
Comments
I can see two kinds of solutions to this.
2 is relatively straightforward, by adding a new type of record into A disadvantage of this is that lists aren't the only places where functions can be hidden -- packages could have environment objects, functions could be assigned as attributes of other objects, etc. Handling attributes wouldn't be hard if lists were handled, but handling environments recursively would have to watch out for infinite loops. Still, it's probably doable. A disadvantage of 1 is that packages might need to be reorganized to do it, and it would be hard for the package writers to maintain. |
In my recent PR igraph/rigraph#1021 to
igraph
, the coverage tests said that the testing didn't include the changed code, even though it did.I put together a simple package with the same structure of running functions that have been assigned into a list, and
covr::package_coverage(type="examples")
also claimed there was no coverage.The example package had this code:
and it exported
test
. The example for the help page fortest
ran this:A version of the package that simply assigned
test <- test1
and rantest()
showed 100% coverage.The full package is available here: https://github.com/dmurdoch/testpkg/tree/test_coverage .
Here's my session info:
The text was updated successfully, but these errors were encountered: