Skip to content

Commit f110076

Browse files
TESTS: In future releases, lazy futures may stay vanilla Future objects [ci skip]
1 parent 8a13643 commit f110076

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: future.batchtools
22
==========================
33

4-
Version: 0.9.0-9000 [2020-10-13]
4+
Version: 0.9.0-9000 [2020-12-21]
55

66
DOCUMENTATION:
77

tests/plan.R

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,23 @@ for (type in c("batchtools_interactive", "batchtools_local")) {
3939
}
4040
plan(type, registry = list(work.dir = NULL))
4141
f <- future(42, lazy = TRUE)
42-
utils::str(list(normalize_path(f$config$reg$work.dir), getwd = getwd()))
43-
stopifnot(normalize_path(f$config$reg$work.dir) == getwd())
42+
## In future releases, lazy futures may stay vanilla Future objects
43+
if (inherits(f, "BatchtoolsFuture")) {
44+
utils::str(list(normalize_path(f$config$reg$work.dir), getwd = getwd()))
45+
stopifnot(normalize_path(f$config$reg$work.dir) == getwd())
46+
}
4447

4548
path <- tempdir()
4649
plan(type, registry = list(work.dir = path))
4750
f <- future(42, lazy = TRUE)
48-
utils::str(list(
49-
normalizePath(f$config$reg$work.dir),
50-
path = normalizePath(path)
51-
))
52-
stopifnot(normalize_path(f$config$reg$work.dir) == normalize_path(path))
51+
## In future releases, lazy futures may stay vanilla Future objects
52+
if (inherits(f, "BatchtoolsFuture")) {
53+
utils::str(list(
54+
normalizePath(f$config$reg$work.dir),
55+
path = normalizePath(path)
56+
))
57+
stopifnot(normalize_path(f$config$reg$work.dir) == normalize_path(path))
58+
}
5359

5460
mprintf("*** plan('%s') ... DONE\n", type)
5561
} # for (type ...)

0 commit comments

Comments
 (0)