tests/testthat/test_helpers.R

skip_on_cran()

test_that("with_cache works", {
  prev_cache_opt = getOption("mlr3oml.cache")
  cache_dir = tempfile()
  oml_data = with_cache(odt(31), cache_dir)
  expect_equal(oml_data$cache_dir, cache_dir)
  expect_equal(prev_cache_opt, getOption("mlr3oml.cache"))
})

test_that("local_log_info works", {
  f = function() {
    local_log_info()
    expect_equal(lg$threshold, 400)
    lg$set_threshold("debug")
  }
  old_threshold = lg$threshold
  f()
  expect_equal(old_threshold, lg$threshold)
})

Try the mlr3oml package in your browser

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

mlr3oml documentation built on Aug. 26, 2025, 5:08 p.m.