| test_fun | R Documentation |
Execute test attached to a function with testthat::Reporter.
test_fun(object, reporter = testthat::MinimalReporter)
object |
to which the test is attached |
reporter |
testthat::Reporter to use |
the test (function)
f <- function(x) x^2
test(f) <- function() {
context("f")
test_that("correct result for complex number", {
expect_equal(f(1i), -1 + 0i)
})
}
test_fun(f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.