test_that("appendToBody", {
## Add a deprecation call into function body.
x <- function() {
"hello"
}
x <- appendToBody(
fun = x,
values = list(
quote(a <- "aaa"),
quote(b <- "bbb")
)
)
expect_type(x, "closure")
## This check approach using `subsitute()` is recommended in `body()`
## working example documentation.
expect_identical(
body(x),
substitute({
a <- "aaa"
b <- "bbb"
"hello"
})
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.