Skip to content

Commit

Permalink
use expect_equal in test-imprr_direct
Browse files Browse the repository at this point in the history
  • Loading branch information
sysilviakim committed Dec 26, 2024
1 parent 07cfb78 commit 7236d61
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions tests/testthat/test-imprr_direct.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
test_that("plug-in estimation works", {

data("identity")

example_direct <- imprr_direct(identity,
J = 4,
main_q = "app_identity",
anc_correct = "anc_correct_identity",
n_bootstrap = 10)


## Otherwise identity data not correctly called
## data("identity") does not work (not sure why?)
identity <- rankingQ::identity
example_direct <- imprr_direct(
identity,
J = 4,
main_q = "app_identity",
anc_correct = "anc_correct_identity",
n_bootstrap = 10
)
expect_equal(
example_direct$est_p_random,
structure(
list(
mean = 0.315068713332798, lower = 0.289994374347022,
upper = 0.344265852286426
),
row.names = c(NA, -1L), class = "data.frame"
)
)
})

0 comments on commit 7236d61

Please sign in to comment.