testthat {testthat} | R Documentation |
Try the example below. Have a look at the references and learn more
from function documentation such as expect_that
.
Software testing is important, but, in part because it is frustrating and boring, many of us avoid it.
testthat is a new testing framework for R that is easy learn and use, and integrates with your existing workflow.
Wickham, H (2011). testthat: Get Started with Testing. The R Journal 3/1 5-10. http://journal.r-project.org/archive/2011-1/RJournal_2011-1_Wickham.pdf
https://github.com/hadley/testthat
http://adv-r.had.co.nz/Testing.html
library(testthat) a <- 9 expect_that(a, is_less_than(10)) expect_less_than(a, 10)