tests/testthat/test_setClasses.R

context("setClasses")

test_that("setClasses", {
  x = list(a=1)
  expect_equal(setClasses(x, "foo"), structure(list(a=1), class="foo"))
  expect_equal(setClasses(x, c("foo1", "foo2")), structure(list(a=1), class=c("foo1", "foo2")))
})

Try the BBmisc package in your browser

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

BBmisc documentation built on Sept. 29, 2022, 5:12 p.m.