test_fun {hySpc.testthat}R Documentation

Run test attached to function

Description

Execute test attached to a function with testthat::Reporter.

Usage

test_fun(object, reporter = "minimal")

Arguments

object

to which the test is attached

reporter

testthat::Reporter to use

Value

the test (function)

Examples


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)

[Package hySpc.testthat version 0.2.1 Index]