tests/testthat/test-s3-expression.R

test_that("expression vectors", {
  expect_snapshot({
    x <- expression(a = 1, x + y)
    construct(x)
    x[[2]] <- structure(quote(x + y), foo = 1)
    construct(x)
    x[[2]] <- expression(x + y)
    construct(x)
    names(x)[[1]] <- NA
    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.