Skip to content

Commit

Permalink
Fix partial match list access (#429)
Browse files Browse the repository at this point in the history
Closes #409
  • Loading branch information
gowerc authored Sep 27, 2024
1 parent 125bcdf commit 48f6e70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/analyse.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-analyse.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down Expand Up @@ -65,6 +68,7 @@ test_that("basic constructions of `analysis` work as expected",{
)
expect_true(validate(x))

options(warnPartialMatchDollar = oldopt)
})


Expand Down

0 comments on commit 48f6e70

Please sign in to comment.