-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
* add check_truncation * add unit tests * add truncation checking to model functions * add news and rename * include new news item
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
test_that("check_pdist works correctly for valid CDF", { | ||
expect_silent(check_pdist(pnorm, D = 10)) | ||
expect_silent(check_pdist(punif, D = 1)) | ||
}) | ||
|
||
test_that("check_pdist throws error for invalid CDF", { | ||
invalid_cdf <- function(x, ...) x^2 - 1 # Not bounded between 0 and 1 | ||
expect_error( | ||
check_pdist(invalid_cdf, D = 10), | ||
"pdist is not a valid cumulative distribution function" | ||
) | ||
}) | ||
|
||
test_that("check_pdist handles infinite D correctly", { | ||
expect_silent(check_pdist(pnorm, D = Inf)) | ||
}) |