Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

unit.test

Embedded Unit Tests


Description

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.

Usage

unit.test(x, expr, framework = NULL, envir = parent.frame())

Arguments

x

single character string used as test identifier/label

expr

expression containing the actual test commands. It is not evaluated, but only stored in the package namespace.

framework

Unit test framework

envir

the definition environment of object x.

Value

a test function with no arguments that wrapping around expr


pkgmaker

Development Utilities for R Packages

v0.32.2
GPL (>= 2)
Authors
Renaud Gaujoux [aut, cre]
Initial release
2020-10-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.