Skip to content

Commit

Permalink
Adjusted #51 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wleoncio committed Sep 10, 2024
1 parent e876aea commit 1265af7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/testthat/test.cat_prop.rho.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ test_that("cat_prop and rho can be specified simultaneously", {
X <- rpois(1L, lambda = 5)
W <- rpois(1L, lambda = 5)
props <- c(as.list(rep(1, X)), rep(list(c(0.5, 1)), W))
expect_output(cluster_gen(c(5, 2), cat_prop = props, rho = runif(1, -1, 1)))
expect_warning(cluster_gen(c(5, 2), n_X = X, n_W = W, cat_prop = props))
r <- runif(1, -0.1, 1)
enn <- c(sample(5:20, 1L), sample(2:5, 1L))
dt_separated_q <- cluster_gen(enn, cat_prop = props, rho = r, verbose = FALSE)
dt_joint_q <- cluster_gen(
enn, cat_prop = props, rho = r, separate_questionnaires = FALSE,
verbose = FALSE
)
expect_s3_class(dt_separated_q, "lsasimcluster")
expect_s3_class(dt_joint_q, "lsasimcluster")
expect_warning(
cluster_gen(enn, n_X = X, n_W = W, cat_prop = props, verbose = FALSE)
)
})

0 comments on commit 1265af7

Please sign in to comment.