tests/testthat/test_mlr_terminators.R

test_that("mlr_terminators", {
  expect_dictionary(mlr_terminators, min_items = 1L)
  keys = mlr_terminators$keys()

  for (key in keys) {
    terminator = trm(key)
    expect_r6(terminator, "Terminator")
  }
})

test_that("mlr_terminators sugar", {
  expect_class(trm("evals"), "Terminator")
  expect_class(trms(c("evals", "evals")), "list")
})

test_that("as.data.table objects parameter", {
  tab = as.data.table(mlr_terminators, objects = TRUE)
  expect_data_table(tab)
  expect_list(tab$object, "Terminator", any.missing = FALSE)
})

Try the bbotk package in your browser

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

bbotk documentation built on Nov. 13, 2023, 5:06 p.m.