https://github.com/cran/scModels
Revision 0dc168df0baeea977e8d8e2f8c37f41eb57a5b73 authored by Lisa Amrhein on 02 September 2019, 23:00:09 UTC, committed by cran-robot on 02 September 2019, 23:00:09 UTC
1 parent 52f2e41
Tip revision: 0dc168df0baeea977e8d8e2f8c37f41eb57a5b73 authored by Lisa Amrhein on 02 September 2019, 23:00:09 UTC
version 1.0.1
version 1.0.1
Tip revision: 0dc168d
test-inappropriate-parameters.R
test_that("Wrong parameters in density function", {
expect_warning(expect_true(is.nan(dpb(0, -1, 3, 20))))
expect_warning(expect_true(is.nan(dpb(1, -1, 3, 20))))
expect_warning(expect_true(is.nan(dpb(1, 5, -1, 20))))
expect_warning(expect_true(is.nan(dpb(1, 5, 3, -1))))
})
test_that("Wrong parameters in distribution function", {
expect_warning(expect_true(is.nan(ppb(2, -1, 3, 20))))
expect_warning(expect_true(is.nan(ppb(2, 5, -1, 20))))
expect_warning(expect_true(is.nan(ppb(2, 5, 3, -1))))
})
test_that("Wrong parameters in quantile function", {
expect_warning(expect_true(is.nan(qpb(-0.5, 5, 3, 20))))
expect_warning(expect_true(is.nan(qpb(0.2, -1, 3, 20))))
expect_warning(expect_true(is.nan(qpb(0.2, 5, -1, 20))))
expect_warning(expect_true(is.nan(qpb(0.2, 5, 3, -1))))
})
test_that("Wrong parameters in RNG function", {
expect_error(rpb(-1, 5, 3, 20))
expect_warning(expect_true(is.na(rpb(1, -1, 3, 20))))
expect_warning(expect_true(is.na(rpb(1, 5, -1, 20))))
expect_warning(expect_true(is.na(rpb(1, 5, 3, -1))))
})

Computing file changes ...