tests/testthat/test_cpr.R

library(cprr)
context('CPR validation')

test_that('Date of birth is corretly calculated from test CPR numbers',
          expect_equal(dob(test_cpr$cpr), test_cpr$dob))

test_that('Gender is corretly calculated from test CPR numbers',
          expect_equal(gender(test_cpr$cpr), test_cpr$gender))

Try the cprr package in your browser

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

cprr documentation built on May 2, 2019, 9:16 a.m.