tests/testthat/test_getClass1.R

context("getClass1")

test_that("getClass1", {
  expect_equal(getClass1(iris), "data.frame")
  expect_equal(getClass1(1), "numeric")
  expect_equal(getClass1(NULL), "NULL")
  x = makeS3Obj(c("C1", "C2"), foo = 2)
  expect_equal(getClass1(x), "C1")
})

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.