library("testthat")
test_that("caller works", {
x <- local({
trace_func("ls.str", "utils")
on.exit(untrace_func("ls.str", asNamespace("utils")))
capture.output(utils::ls.str(1), type = "message")
})
testthat::expect_match(x[1], "....-..-.. ..:..:..... .0. utils..ls.str.1.")
testthat::expect_match(x[2], "....-..-.. ..:..:..... .0. exit")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.