tests/testthat/test-s3-AsIs.R

test_that("AsIs", {
  expect_snapshot({
    construct(I(month.abb))
    construct(I(month.abb), opts_AsIs("next"))
    construct(I(head(cars,2)))

    x <- 1
    class(x) <- c("AsIs", "foo")
    construct(x)

    class(x) <- c("foo", "AsIs")
    construct(x)
  })
})

Try the constructive package in your browser

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

constructive documentation built on April 3, 2025, 9:39 p.m.