r-lib / R6

Encapsulated object-oriented programming for R
https://R6.r-lib.org
Other
410 stars 56 forks source link

Added tests on as.list, is.R6, and is.R6Class #171

Closed jameslamb closed 5 years ago

jameslamb commented 5 years ago

Thank you for this awesome project! I use R6 every day and it's made me a much more productive R programmer.

To thank you, I thought I'd come in and look for easy tests to write that could cover some currently-uncovered lines in the codebase. I hope you'll consider this PR to add minimal unit tests on as.list(), is.R6(), and is.R6Class().

I found these uncovered lines with this nifty thing my friends and I user in our projects:

Rscript -e "coverage <- covr::package_coverage('.'); print(coverage); covr::report(coverage, './coverage.html')"
open coverage.html
wch commented 5 years ago

I'm glad that you find R6 useful, and thanks for contributing! Regarding this pull request, I think that for those particular functions, there's no need for tests since they are so simple. Adding tests for them results in more code but not much benefit. If you'd like to tackle open issues with R6, #173 should be a pretty straightforward one.