Skip to content

Commit

Permalink
add an additional test for very truncated random sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
seabbs committed Sep 2, 2024
1 parent f9f877d commit 4439717
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/testthat/test-rprimarycensoreddist.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,16 @@ test_that("rprimarycensoreddist handles different primary distributions", {

expect_true(all(samples >= 0 & samples < D))
})

test_that("rprimarycensoreddist handles very truncated distributions", {
n <- 1000
pwindow <- 0.1
D <- 1

samples <- rpcens(
n, rnorm, pwindow,
D = D, mean = 0.5, sd = 1
)

expect_true(all(samples >= 0 & samples < D))
})

0 comments on commit 4439717

Please sign in to comment.