Account for vectors of length 0 when cleaning coverage#632
Open
maksymiuks wants to merge 9 commits into
Open
Conversation
* Fix rare count_test edge case * fix name typo
Co-authored-by: Jim Hester <[email protected]>
Member
|
Could you add a test case to verify we don't break this in the future, thanks! |
Contributor
Author
|
@jimhester Added the test. I figured it's better to prepare a dummy problematic object rather than an example package, so the test case is more robust and we are sure the function handles the problem well regardless of the source. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @jimhester, I'm sorry for bothering again. Apparently, my previous PR didn't cover an edge case of an edge case, or rather, by solving one, I created another. I'm sorry for that.
covr/R/covr.R
Line 669 in f1866d2
valvariable, in particular scenarios, can haveinteger(0)value and because of this R behaviour:we end up with an NA in the conditional. That's why I've rewritten the condition to use
length(val) == 0instead ofis.null(val). It is more robust and covers more of the cases that are problematic for that function, because bothNULLandinteger(0)are of length 0. There should be no more problems with that function anymore.Closes #631