tests/testthat/test-zzz.R

# Package message-------------------
test_that("Package attach message", {
  if (interactive()) {
    print_output <- capture.output(.onAttach(libname = "dummy_lib", pkgname = "bvhar"))
    if (is_omp()) {
      expect_true(grepl("OpenMP threads: [0-9]+", print_output))
    } else {
      expect_true(grepl("OpenMP not available in this machine", print_output))
    }
  } else {
    skip(".onAttach() prints nothing in non-interactive.")
  }
})
#> Test passed 🌈

Try the bvhar package in your browser

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

bvhar documentation built on April 4, 2025, 5:22 a.m.