tests/testthat/test-anonymize.R

library(anonymizer)
context("anonymize()")

test_that("Produces the correct output.", {
  expect_equal(anonymize("a", .seed = 1), "ed879445e47969394b3f8eb818501976bed22b9ab0e7f7c5fdf2a96df0aec80e")
})

test_that("Produces the correct output type.", {
  expect_is(anonymize(letters), "character")
})

test_that("Produces the correct errors.", {
  expect_error(anonymize(mtcars))
})

Try the anonymizer package in your browser

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

anonymizer documentation built on May 29, 2017, 9:29 a.m.