Description Usage Arguments Value See Also Examples
Converts a single RUnit test to a testthat test.
1 2 | convert_test(runit_test_fn,
test_description = assertive::get_name_in_parent(runit_test_fn))
|
runit_test_fn |
An |
test_description |
A string describing the test, defaulting to
the name of the |
A call to test_that
, containing a testhat
test
equivalent to the input RUnit
test.
convert_package_tests
, convert_test_file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | test_truth <- function()
{
x <- all(runif(10) > 0)
checkTrue(x)
}
convert_test(test_truth)
test_equality <- function()
{
x <- sqrt(1:5)
expected <- c(1, 4, 9, 16, 25)
checkEquals(expected, x ^ 4)
}
convert_test(test_equality)
test_error <- function()
{
checkException("1" + "2")
}
convert_test(test_error)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.