@@ -18,6 +18,7 @@ for (strategy in strategies) {
1818 n <- nbrOfWorkers()
1919 message(sprintf(" nbrOfWorkers: %d" , n ))
2020 stopifnot(n == 1L )
21+ stopifnot(is.null(attr(n , " class" )))
2122
2223 n <- nbrOfFreeWorkers()
2324 message(sprintf(" nbrOfFreeWorkers: %d" , n ))
@@ -55,6 +56,7 @@ for (strategy in strategies) {
5556 n <- nbrOfWorkers()
5657 message(sprintf(" nbrOfWorkers: %d" , n ))
5758 stopifnot(n == nworkers )
59+ stopifnot(is.null(attr(n , " class" )))
5860
5961 n <- nbrOfFreeWorkers()
6062 message(sprintf(" nbrOfFreeWorkers: %d" , n ))
@@ -120,4 +122,19 @@ message(sprintf("nbrOfWorkers: %g", n))
120122stopifnot(n == length(workers ))
121123parallel :: stopCluster(workers )
122124
125+ message(" Type of future: multicore/multisession with workers = I(1L)" )
126+ for (strategy in c(" multicore" , " multisession" )) {
127+ if (strategy %in% supportedStrategies()) {
128+ plan(strategy , workers = I(1L ))
129+ n <- nbrOfWorkers()
130+ message(sprintf(" nbrOfWorkers (%s): %g" , strategy , n ))
131+ stopifnot(n == 1L )
132+ if (strategy == " multicore" ) {
133+ stopifnot(inherits(n , " AsIs" ))
134+ } else {
135+ stopifnot(is.null(attr(n , " class" )))
136+ }
137+ }
138+ }
139+
123140message(" *** nbrOfWorkers() ... DONE" )
0 commit comments