Skip to content

Conversation

@maksymiuks
Copy link
Contributor

Hi!

In our enterprise solution, we have discovered a peculiar edge case when count_test function is called with .current_test not yet initialized, leading to error:

Error in tests$.data[[1L]] <- .current_test$index : 
  replacement has length zero

For us, we encountered it when calculating coverage for the digest when using tinytest Ubuntu libraries (funnily enough, when installing tinytest from source, the issue did not appear). That makes reproducing the issue really tedious, although I was able to do it on macOS as well. Nevertheless, I believe that there is no harm in adding that if statement to cover that edge case, even if it's super rare, simply to make sure the covr is not vulnerable to weird/unexpected package combinations in the future.

* Fix rare count_test edge case

* fix name typo
Copy link
Member

@jimhester jimhester left a comment

Choose a reason for hiding this comment

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

Had one minor style change suggestion.

Also can you please add a bullet to NEWS? It should briefly describe the change and end with (@yourname, #issuenumber).

@maksymiuks
Copy link
Contributor Author

@jimhester Thank you very much for the review, one question from me

Also can you please add a bullet to NEWS? It should briefly describe the change and end with (@yourname, #issuenumber).

Do you mean that the current bullet is not clear enough, or would you prefer that I create an issue for this (currently there is no open issue, I created this PR right after figuring out the problem)?

@maksymiuks maksymiuks requested a review from jimhester November 14, 2025 16:57
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