diff --git a/R/analyse.R b/R/analyse.R index b313d74b5..b06cac7ff 100644 --- a/R/analyse.R +++ b/R/analyse.R @@ -378,8 +378,8 @@ validate.analysis <- function(x, ...) { if (next_class %in% c("bootstrap", "rubin")) { nsamp <- ife( next_class %in% c("bootstrap"), - x$method$n_sample + 1, - x$method$n_sample + x$method$n_samples + 1, + x$method$n_samples ) assert_that( length(x$results) == nsamp diff --git a/tests/testthat/test-analyse.R b/tests/testthat/test-analyse.R index ef294d176..900659bc6 100644 --- a/tests/testthat/test-analyse.R +++ b/tests/testthat/test-analyse.R @@ -6,6 +6,9 @@ suppressPackageStartupMessages({ test_that("basic constructions of `analysis` work as expected",{ + oldopt <- getOption("warnPartialMatchDollar") + options(warnPartialMatchDollar = TRUE) + x <- as_analysis( results = list( list(p1 = list("est" = 1)), @@ -65,6 +68,7 @@ test_that("basic constructions of `analysis` work as expected",{ ) expect_true(validate(x)) + options(warnPartialMatchDollar = oldopt) })