powered by
Execute test attached to a function with testthat::Reporter.
test_fun(object, reporter = testthat::MinimalReporter)
the test (function)
to which the test is attached
testthat::Reporter to use
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)
Run the code above in your browser using DataLab