tests/testthat/test_ids.R

test_that("ids", {
  Foo = R6::R6Class("Foo", public = list(id = NULL, initialize = function(id) self$id = id), cloneable = TRUE)
  f1 = Foo$new("f1")
  f2 = Foo$new("f2")
  xs = list(f1, f2)
  expect_equal(ids(xs), c("f1", "f2"))
  expect_equal(ids(list()), character())
})
mlr-org/mlr3misc documentation built on June 12, 2025, 9:54 p.m.