tests/testthat/test_functions.R

library(numbat)

test_that("Check that roman2int works as expected", {
   val.3899 <- 'MMMDCCCXCIX'
   val.3900 <- 'MMMCM'
   val.4000 <- 'MMMM'
   expect_equal(names(roman2int(val.3899)), "MMMDCCCXCIX")
   expect_equal(as.integer(roman2int(val.3899)), 3899)
   expect_equal(names(roman2int(val.3900)), "MMMCM")
   expect_equal(as.integer(roman2int(val.3900)), 3900)
   expect_equal(names(roman2int(val.4000)), "MMMM")
   expect_equal(as.integer(roman2int(val.4000)), 4000)   
})

Try the numbat package in your browser

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

numbat documentation built on May 29, 2024, 1:29 a.m.