Skip to content

Commit 81eb712

Browse files
committed
non-functioning test example
1 parent 396dcb4 commit 81eb712

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/tests/test-03-array.R

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,5 +205,35 @@ test_that('array', {
205205
setwd('..')
206206
SimClean(dirs='sim/')
207207

208+
#####################
209+
210+
# summary list
211+
212+
Summarise_list <- function(condition, results, fixed_objects) {
213+
list(a=42, b=rnorm(5))
214+
}
215+
216+
# Emulate distribution to nrow(Design5) = 15 independent job arrays
217+
sapply(1:nrow(Design5), \(arrayID)
218+
runArraySimulation(design=Design5, replications=10,
219+
generate=Generate, analyse=Analyse,
220+
summarise=Summarise_list, iseed=iseed, arrayID=arrayID,
221+
dirname='sim', filename='condition', verbose=FALSE)) |> invisible()
222+
223+
files <- dir('sim/')
224+
expect_true(all(files %in% paste0('condition-', 1:nrow(Design5), '.rds')))
225+
226+
setwd('sim')
227+
# final <- SimCollect(files=dir())
228+
so <- summary(final)
229+
expect_equal(so$ncores, 15L)
230+
results <- SimResults(final)
231+
232+
expect_equal(final$REPLICATIONS, c(50, 50, 50))
233+
expect_equal(length(results), 150)
234+
235+
setwd('..')
236+
SimClean(dirs='sim/')
237+
208238
})
209239

0 commit comments

Comments
 (0)