File: test_parallelGetOptions.R

package info (click to toggle)
r-cran-parallelmap 1.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 336 kB
  • sloc: sh: 13; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 602 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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\\)"
  )
})