tests/testthat/test-memoise.R

context("Memoise")

test_that(
    "Memoised functions product the same result", {
    cache_path <- file.path(tempdir(), ".CellBenchCache")
    set_cellbench_cache_path(cache_path)
    fn <- function(x) { x }
    mfn <- cache_method(fn)

    expect_identical(mfn(1), fn(1))
    expect_message(clear_cellbench_cache())
})

Try the CellBench package in your browser

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

CellBench documentation built on Nov. 8, 2020, 5:11 p.m.