tests/testthat/test-distributions.R

test_that("Domains of distribution parameters are valid", {
    expect_error(expValPois(-2), "lambda > 0 is not TRUE")
    expect_error(expValGamma(-2, 2), "shape > 0 is not TRUE")
})

test_that("Means of distributions are as expected", {
    expect_equal(expValPois(5), 5)
    expect_equal(expValNorm(5, 2), 5)
})

Try the Distributacalcul package in your browser

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

Distributacalcul documentation built on Sept. 13, 2020, 5:19 p.m.