Skip to content

Commit

Permalink
change test with tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
zkamvar committed May 16, 2024
1 parent 39799ff commit 63b2051
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/testthat/test-round-robin.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,10 @@ test_that("correction is properly applied in rraf", {

# sum_to_one argument augments does what it says
monc_sum2one <- vapply(monc_sto, sum, numeric(1))
tol <- min(monc_vec - monc_sum2one)
expect_lt(tol, 1)
expect_equal(sum(monc_sum2one), nLoc(monpop))
expect_true(all(monc_vec >= monc_sum2one),
label = paste0(paste(capture.output(
data.frame(vec = monc_vec, sum2one = monc_sum2one, equal = monc_vec >= monc_sum2one)
), collapse = "\n"), "\n")
)

expect_equal(monc_vec, monc_sum2one, tolerance = tol)
# The default is 1/n
expect_equivalent(SER(monc), 1/nInd(monpop))
expect_true(identical(SER(monc)[[1]], SED(monc)[[1]]))
Expand Down

0 comments on commit 63b2051

Please sign in to comment.