tests/testthat/test-change_date_separator.R

test_that("multiplication works", {

  expect_equal(change_date_separator(c("1401/01/02", "1402/03/04"), "-")
               , c("1401-01-02", "1402-03-04"))

  msg <- "change separator: The new separator does not belong to the set of valid separators!"
  expect_error(change_date_separator(c("1401/01/02", "1402/03/04"), "$")
               , msg)

  msg <- "change separator: The number of character of the separator must be 0 or 1!"
  expect_error(change_date_separator(c("1401/01/02", "1402/03/04"), "$$")
               , msg)


})

Try the RJalaliDate package in your browser

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

RJalaliDate documentation built on Sept. 11, 2024, 8:26 p.m.