Skip to content

Commit

Permalink
TESTS: Another two tests need to be conditioned on mirai (>= 0.13.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Apr 12, 2024
1 parent b46a112 commit 9a91f38
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: future.mirai
Version: 0.1.1-9017
Version: 0.1.1-9018
Depends:
future
Imports:
Expand Down
19 changes: 11 additions & 8 deletions tests/globals,formulas.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,17 @@ outer_function <- function(x) {
y0 <- outer_function(1L)
str(y0)

f <- future({ outer_function(1L) })
y <- value(f)
str(y)
stopifnot(all.equal(y, y0))

y %<-% { outer_function(1L) }
str(y)
stopifnot(all.equal(y, y0))
## This requires mirai (>= 0.13.2)
if (packageVersion("mirai") >= "0.13.2") {
f <- future({ outer_function(1L) })
y <- value(f)
str(y)
stopifnot(all.equal(y, y0))

y %<-% { outer_function(1L) }
str(y)
stopifnot(all.equal(y, y0))
}

message("*** Globals - map(x, ~ expr) ... DONE")

Expand Down
5 changes: 5 additions & 0 deletions tests/zzz,future_lapply.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## This requires mirai (>= 0.13.2)
if (packageVersion("mirai") >= "0.13.2") {

source("incl/start.R")
library("listenv")

Expand Down Expand Up @@ -129,3 +132,5 @@ if (requireNamespace("future.apply", quietly = TRUE)) {
}

source("incl/end.R")

}

0 comments on commit 9a91f38

Please sign in to comment.