tests/testthat/test-model-initialization.R

test_that("Model initialization works", {
  # Valid initialization
  mod <- Model$new(glmnet::glmnet)
  expect_s3_class(mod, "Model")
  expect_s3_class(mod, "R6")
  expect_null(mod$fitted)
  expect_null(mod$task)
  
  # Invalid initialization
  expect_error(Model$new("not_a_function"))
  expect_error(Model$new(123))
})

Try the unifiedml package in your browser

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

unifiedml documentation built on April 3, 2026, 5:06 p.m.