tests/testthat/test_parallelGetOptions.R

context("get / print options")

test_that("get / print options", {
  opts = parallelGetOptions()
  expect_true(is.list(opts))
  expect_equal(names(opts), c("settings", "defaults"))
  expect_equal(names(opts$settings), names(opts$defaults))

  capture.output(
    print(parallelGetOptions())
  )
})

# issue https://github.com/mlr-org/parallelMap/issues/41
test_that("parallelGetOptions() prints the state of the object", {
  parallelStartSocket(2)
  y = parallelGetOptions()
  parallelStop()

  expect_match(
    capture.output(print(y))[3],
    "mode                : socket     \\(not set\\)"
  )
})

Try the parallelMap package in your browser

Any scripts or data that you put into this service are public.

parallelMap documentation built on June 28, 2021, 9:07 a.m.