if (.Platform[["OS.type"]] != "windows") {
  library(future)
  
  message("*** batchtools_ssh() ...")
  
  plan(future.batchtools::batchtools_ssh, workers = rep("localhost", times = 2))
  supports_ssh <- tryCatch({
    f <- future(42L)
    v <- value(f)
    identical(v, 42L)
  }, error = function(e) FALSE)
  message("Supports batchtools_ssh: ", supports_ssh)
  
  if (supports_ssh) {
    message("future(a) ...")
    a0 <- a <- 42
    f <- future(a)
    stopifnot(identical(f$globals$a, a0))
    v <- value(f)
    stopifnot(identical(v, a0))
  
    message("future(a, lazy = TRUE) ...")
    a0 <- a <- 42
    f <- future(a, lazy = TRUE)
    rm(list = "a")
    stopifnot(identical(f$globals$a, a0))
    v <- value(f)
    stopifnot(identical(v, a0))
  } ## if (supports_ssh)

  plan(sequential)
  
  message("*** batchtools_ssh() ... DONE")
}


