Skip to content

Commit

Permalink
fix tolerance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zkamvar committed May 16, 2024
1 parent 2e149a3 commit db93b78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/testthat/test-round-robin.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ 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)
# If the sum to one works, then we should have leftover tolerance that is
# greater than zero but less than one.
tol <- sum(monc_vec - monc_sum2one)
expect_lt(tol, 1)
expect_gt(tol, 0)
expect_equal(sum(monc_sum2one), nLoc(monpop))
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 db93b78

Please sign in to comment.