tests/testthat/test-drop_safeframe.R

test_that("tests for drop_safeframe", {
  x <- make_safeframe(cars, mph = "speed")
  expect_identical(cars, drop_safeframe(x, remove_tags = TRUE))

  y <- drop_safeframe(x, remove_tags = FALSE)
  expect_identical(tags(x), tags(y))

  y <- drop_safeframe(x, remove_tags = TRUE)
  expect_null(attr(y$speed, "label"))
  expect_null(attr(y$dist, "label"))
})

Try the safeframe package in your browser

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

safeframe documentation built on June 28, 2025, 1:08 a.m.