tests/testthat/test-tidyer.R

test_that("Tidyer works", {
  
  filter_func <- \(data) filter(data, species == "Human") 
  
  .tidyer <- Tidyer$new(filter_func)

  new.data <- .tidyer$mutate(starwars)
  
  expect_equal(
    unique(new.data$species),
    "Human"
  )
  
  expect_error(.tidyer$serialize())
  
  expect_equal(.tidyer$str(), "Tidyer(fn = filter_func)") 
})

Try the deident package in your browser

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

deident documentation built on April 3, 2025, 6:14 p.m.