test-set.RdThis function attaches unit tests in value to an object (typically a
function) as an attribute "test".
test(f) <- valuef with the test attached as attribute "test"
f <- function(x) x^2
test(f) <- function() {
context("f")
test_that("correct result for complex number", {
expect_equal(f(1i), -1 + 0i)
})
}