R version 4.6.0 RC (2026-04-22 r89945 ucrt) -- "Because it was There" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > #! /usr/bin/env Rscript > ## This runs testme test script inst/testme/test-internals.R > ## Don't edit - it was autogenerated by inst/testme/deploy.R > future.batchtools:::testme("internals") Test 'internals' ... chr "none" > library(future.batchtools) Loading required package: future > message("*** Internals ...") *** Internals ... > options(future.delete = TRUE) > Sys.setenv(R_FUTURE_BATCHTOOLS_DEBUG = "TRUE") > future.batchtools:::update_package_options(debug = TRUE) [00:52:42.793] Environment variable 'R_FUTURE_BATCHTOOLS_DELETE' not set [00:52:42.795] Environment variable 'R_FUTURE_BATCHTOOLS_EXPIRATION_TAIL' not set [00:52:42.796] Environment variable 'R_FUTURE_BATCHTOOLS_OUTPUT' not set [00:52:42.797] Environment variable 'R_FUTURE_BATCHTOOLS_WORKERS' not set [00:52:42.798] Environment variable 'R_FUTURE_BATCHTOOLS_STATUS_CACHE' not set [1] TRUE > future.batchtools:::update_package_option("future.batchtools.debug", + mode = "logical", force = TRUE, debug = TRUE) [00:52:42.800] R_FUTURE_BATCHTOOLS_DEBUG='TRUE' [00:52:42.801] Coercing from character to logical: 'TRUE' [00:52:42.802] => options("future.batchtools.debug" = 'TRUE') [n=1, mode=logical] [1] TRUE > options(future.batchtools.debug = "always") > Sys.setenv(R_FUTURE_BATCHTOOLS_FOO = "abc,def") > future.batchtools:::update_package_option("future.batchtools.foo", + mode = "character", split = ",", force = TRUE, debug = TRUE) [00:52:42.803] R_FUTURE_BATCHTOOLS_FOO='abc,def' [00:52:42.805] => options("future.batchtools.foo" = 'abc', 'def') [n=2, mode=character] [1] "abc" "def" > Sys.setenv(R_FUTURE_BATCHTOOLS_FOO = "") > future.batchtools:::update_package_option("future.batchtools.foo", + mode = "character", split = ",", force = TRUE, debug = TRUE) [00:52:42.806] Environment variable 'R_FUTURE_BATCHTOOLS_FOO' not set [1] "abc" "def" > Sys.setenv(R_FUTURE_BATCHTOOLS_BAR = "NA") > tryCatch(future.batchtools:::update_package_option("future.batchtools.bar", + mode = "integer", force = TRUE, debug = TRUE), error = identity) [00:52:42.808] R_FUTURE_BATCHTOOLS_BAR='NA' [00:52:42.809] Coercing from character to integer: 'NA' > Sys.setenv(R_FUTURE_BATCHTOOLS_BAR = "-1") > tryCatch(future.batchtools:::update_package_option("future.batchtools.bar", + mode = "integer", disallow = "negative", force = TRUE, debug = TR .... [TRUNCATED] [00:52:42.811] R_FUTURE_BATCHTOOLS_BAR='-1' [00:52:42.812] Coercing from character to integer: '-1' > Sys.setenv(R_FUTURE_BATCHTOOLS_BAR = "0") > tryCatch(future.batchtools:::update_package_option("future.batchtools.bar", + mode = "integer", disallow = "non-positive", force = TRUE, + .... [TRUNCATED] [00:52:42.814] R_FUTURE_BATCHTOOLS_BAR='0' [00:52:42.815] Coercing from character to integer: '0' > path <- future.batchtools:::find_template_file("slurm") > stopifnot(file.exists(path)) > res <- try(future.batchtools:::find_template_file("non-existing-template"), + silent = TRUE) > stopifnot(inherits(res, "try-error")) > if (future.batchtools:::is_os("linux") || future.batchtools:::is_os("macos")) { + res <- future.batchtools:::runOSCommand("echo", "hello") + .... [TRUNCATED] > res <- future.batchtools:::runOSCommand("non-existing-command-xyz") > stopifnot(res$exit.code == 127) > stopifnot(future.batchtools:::as_valid_directory_prefix("abc-123_.") == + "abc-123_.") > stopifnot(future.batchtools:::as_valid_directory_prefix("abc!@#") == + "abc") > stopifnot(future.batchtools:::as_valid_registry_id("A123_") == + "A123_") > stopifnot(grepl("^[a-zA-Z]", future.batchtools:::as_valid_registry_id("123"))) > res <- try(future.batchtools:::stopf("error %d", 1), + silent = TRUE) > stopifnot(inherits(res, "try-error")) > res <- tryCatch(future.batchtools:::warnf("warning %d", + 1), warning = function(w) w) > stopifnot(inherits(res, "warning")) > mockMakeCluster <- function(workers, ...) { + list(workers = workers, ...) + } > res <- future.batchtools:::BatchtoolsSSHRegistry(action = "start", + workers = 1, makeCluster = mockMakeCluster) > stopifnot(identical(res$workers, 1)) > res_get <- future.batchtools:::BatchtoolsSSHRegistry(action = "get") > stopifnot(identical(res, res_get)) > future.batchtools:::BatchtoolsSSHRegistry(action = "stop") > res_null <- future.batchtools:::BatchtoolsSSHRegistry(action = "get") > stopifnot(is.null(res_null)) > reg <- future.batchtools:::temp_registry(label = "test-reg") > stopifnot(inherits(reg, "Registry")) > unlink(reg$file.dir, recursive = TRUE) > future.batchtools:::mdebug("test mdebug") [00:52:42.947] test mdebug > future.batchtools:::mdebugf("test mdebugf %d", 1) [00:52:42.948] test mdebugf 1 > future.batchtools:::mdebug_push("push") [00:52:42.948] push > future.batchtools:::mdebug_pop() [00:52:42.949] push done > future.batchtools:::mdebugf_push("pushf") [00:52:42.950] pushf > future.batchtools:::mdebugf_pop() [00:52:42.950] pushf done > future.batchtools:::mprint(list(a = 1)) [00:52:42.951] $a [00:52:42.951] [1] 1 [00:52:42.951] > future.batchtools:::mstr(list(a = 1)) [00:52:42.952] List of 1 [00:52:42.952] $ a: num 1 > stopifnot(future.batchtools:::is_na(NA)) > stopifnot(!future.batchtools:::is_na(1)) > stopifnot(future.batchtools:::is_false(FALSE)) > stopifnot(!future.batchtools:::is_false(TRUE)) > stopifnot(future.batchtools:::hpaste(1:3) == "1, 2, 3") > stopifnot(future.batchtools:::hpaste(1:10, max_head = 2, + max_tail = 1) == "1, 2, ..., 10") > stopifnot(future.batchtools:::trim(" abc ") == "abc") > options(useFancyQuotes = FALSE) > stopifnot(future.batchtools:::comma(1:3) == "1, 2, 3") > stopifnot(future.batchtools:::commaq(1:3) == "'1', '2', '3'") > tmp_file <- tempfile() > writeLines("test", tmp_file) > info <- future.batchtools:::file_info(tmp_file) > stopifnot(grepl("bytes", info, fixed = TRUE)) > stopifnot(grepl("lines", info, fixed = TRUE)) > unlink(tmp_file) > info_na <- future.batchtools:::file_info(NA) > stopifnot(info_na == "") > info_non <- future.batchtools:::file_info("non-existing") > stopifnot(grepl("non-existing", info_non, fixed = TRUE)) > tmp_dir <- tempdir() > info_dir <- future.batchtools:::dir_info(tmp_dir) > stopifnot(grepl(tmp_dir, info_dir, fixed = TRUE)) > out <- future.batchtools:::capture_output(cat("hello\nworld")) > stopifnot(identical(out, c("hello", "world"))) > message("*** Internals ... done") *** Internals ... done Failed to undo environment variables: - Expected environment variables: [n=220] '!ExitCode', 'ALLUSERSPROFILE', 'APPDATA', ..., 'tempdirname' - Environment variables still there: [n=0] - Environment variables missing: [n=1] 'MAKEFLAGS' Differences environment variable by environment variable: Skipping, because path appears not to be an 'R CMD check' folder: 'D:/temp/2026_04_25_00_50_17_18966' Test time: user.self=0.3s, sys.self=0.06s, elapsed=0.4s, user.child=NAs, sys.child=NAs Test 'tempdirname' ... success > > proc.time() user system elapsed 0.92 0.20 1.12