inst/runit_tests/runit_internals.R

test_get_function_body <- function() {
    assign("f", function() print(3))
    result <- cleanr:::get_function_body(f)
    expectation <- "print(3)"
    print(result)
    RUnit::checkIdentical(result, expectation)
}

Try the cleanr package in your browser

Any scripts or data that you put into this service are public.

cleanr documentation built on July 9, 2023, 7:30 p.m.