File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ source(" incl/start.R" )
2+ options(future.debug = FALSE )
3+
4+ foo <- function (... , FUN = function (... ) list (... )) {
5+ args <- list (... )
6+ future_lapply(1L , FUN = function (x ) {
7+ do.call(FUN , args = c(list (x ), args ))
8+ })
9+ }
10+
11+ bar <- function (... , fun = function (... ) list (... )) {
12+ future_lapply(1L , FUN = function (x ) fun(x , ... ))
13+ }
14+
15+ yaa <- function (... , FUN = function (... ) list (... )) {
16+ future_lapply(1L , FUN = function (x ) {
17+ do.call(FUN , args = c(list (x ), ... ))
18+ })
19+ }
20+
21+
22+ for (strategy in supportedStrategies()) {
23+ message(sprintf(" - plan('%s') ..." , strategy ))
24+ plan(strategy )
25+
26+ x1 <- foo()
27+ y1 <- bar()
28+ stopifnot(identical(y1 , x1 ))
29+ z1 <- yaa()
30+ stopifnot(identical(z1 , x1 ))
31+
32+ x2 <- foo(a = 2 )
33+ if (packageVersion(" future" ) > " 1.40.0-9200" ) {
34+ y2 <- bar(a = 2 )
35+ z2 <- yaa(a = 2 )
36+ stopifnot(identical(y2 , x2 ))
37+ stopifnot(identical(z2 , x2 ))
38+ }
39+
40+ message(sprintf(" - plan('%s') ... done" , strategy ))
41+ }
42+
43+ source(" incl/end.R" )
You can’t perform that action at this time.
0 commit comments