tests/testthat/test-category_blur.R

test_that("cateogry blur basics", {
  
  .vec <- starwars$species
  
  species_blur <- category_blur(.vec, NonHuman = "^(?!Human)")    
  
  expect_false(
    "Human" %in% names(species_blur)  
  )
  
  expect_equal(
    length(species_blur) + 1,
    length(unique(.vec))
  )
})

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.