tests/testthat/test-Params.R

context("Params")

test_that("setParam sets correctly", {
    params <- newSimpleParams()
    params <- setParam(params, "nGenes", 100)
    expect_equal(getParam(params, "nGenes"), 100)
    params <- setParam(params, "mean.rate", 0.5)
    expect_equal(getParam(params, "mean.rate"), 0.5)
})

test_that("getParam gets correctly", {
    params <- newSimpleParams()
    expect_equal(getParam(params, "nGenes"), 10000)
    expect_equal(getParam(params, "mean.rate"), 0.3)
})

Try the splatter package in your browser

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

splatter documentation built on Dec. 3, 2020, 2:01 a.m.