inst/tests/testhelpers.R

#!/usr/bin/Rscript
# vim:set ff=unix expandtab ts=2 sw=2:
checkWarning <- function(expr,silent=TRUE) {
    checkTrue(
    inherits(
       tryCatch(
         eval(expr, envir = parent.frame()), 
         silent = silent,
         warning=function(w){w}
       ),
       "warning"
    ),
        "Warning not generated as expected\n")
}             

Try the SoilR package in your browser

Any scripts or data that you put into this service are public.

SoilR documentation built on May 4, 2017, 9:08 p.m.