This roclet is a workhorse of roxytest, producing the testthat test files specified.

Generally you will not call this function directly but will instead use roxygen2::roxygenise() specifying this roclet.

testthat_roclet()

Value

A roclet to be used e.g. with roxygen2::roxygenise()

Examples

x <- "#' @tests\n#' expect_equal(2, 2)\nNULL\n"
cat(x)
#> #' @tests
#> #' expect_equal(2, 2)
#> NULL
o <- roxygen2::roc_proc_text(testthat_roclet(), x)
cat(o$tests[[1]])
#> # Generated by roxytest: Do not edit by hand!
#> 
#> # <text>
#> 
#> test_that("[unknown alias] @ L3", {
#>   expect_equal(2, 2)
#> })