tests/testthat/test-setup_parallel.R

test_that("setup_parallel works as expected", {
  # Test setup_parallel with default cores (7)
  cl <- setup_parallel(num_cores = 2)  # Use 2 cores to avoid heavy load in tests
  expect_true(inherits(cl, "cluster"))  # Check if the object is a parallel cluster
  expect_equal(length(cl), 2)  # Check if the cluster has 2 cores
  parallel::stopCluster(cl)  # Stop the cluster after the test
})

Try the REN package in your browser

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

REN documentation built on Oct. 10, 2024, 5:06 p.m.