tests/testthat/test_packages.R

context("Packages")

test_that("Package loading works", {
  d <- foreach(1:10, .packages='splines', .combine='c') %dopar%
               xyVector(c(1:3), c(4:6))[[1]]
  expect_true(all(c(1:3) == d))
})

Try the foreach package in your browser

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

foreach documentation built on Feb. 2, 2022, 5:09 p.m.