tests/testthat/test-attributes.R

test_that("exattr", {
  x <- struct(list(), "foo", aa = 1, a = 2)
  expect_identical(x %attr% "a", 2)

  x <- struct(list(), "foo", aa = 1)
  expect_null(x %attr% "a")
})

Try the fuj package in your browser

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

fuj documentation built on June 8, 2025, 10:23 a.m.