The function unit.test
provides a way to write
unit tests embedded within package source files. These
tests are stored and organised in the package namespace,
and can be run using the unified interface provided by
the function link{utest}
. Both Runit and testthat
tests are supported -- and automatically detected.
unit.test(x, expr, framework = NULL,
envir = parent.frame())
single character string used as test identifier/label
expression containing the actual test commands. It is not evaluated, but only stored in the package namespace.
Unit test framework
the definition environment of object
x
.
a test function with no arguments that wrapping around
expr