tests/testthat/test-zzz.R

test_that(".onLoad works", {
  .onLoad()
  expect_true(TRUE)
})

test_that("onAttach works", {
  .onAttach()
  expect_true(TRUE)
})

test_that(".onAttach warns about mismatched heap size", {
  skip_if_no_tetrad()

  options(java.heap.size = "4g")

  expect_message(
    .onAttach(),
    regexp = "WARNING: Java heap is 2 GB but you requested 4 GB"
  )
})

test_that(".onAttach does not warn about minimal mismatched heap size", {
  skip_if_no_tetrad()

  options(java.heap.size = "2050m")

  expect_message(
    .onAttach(),
    regexp = "Java successfully initialized with 2 GB."
  )
})

Try the causalDisco package in your browser

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

causalDisco documentation built on April 13, 2026, 5:06 p.m.