tests/testthat/test-is_jalali_leap_year.R

test_that("multiplication works", {

  expect_equal(is_jalali_leap_year(c(1400, 1401, 1402, 1403, 1404, NA))
               , c(FALSE, FALSE, FALSE, TRUE, FALSE, FALSE))

  expect_equal(is_jalali_leap_year(NA), FALSE)

  expect_error(is_jalali_leap_year()
               , "argument \"year\" is missing, with no default")

  expect_error(is_jalali_leap_year("1401")
               , "non-numeric argument to mathematical function")

})

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.