tests/testthat/test-set.R

test_that("set functions work properly", {
  expect_equal(unclass(md_union(as_messydate("2012-01-01..2012-01-03"),
                                as_messydate("2012-01-03..2012-01-04"))),
               c("2012-01-01", "2012-01-02", "2012-01-03", "2012-01-04"))
  expect_equal(unclass(md_intersect(as_messydate("2012-01-01..2012-01-03"),
                                    as_messydate("2012-01-02"))),
               "2012-01-02")
  expect_equal(unclass(md_multiset(as_messydate("2012-01-01..2012-01-03"),
                                   as_messydate("2012-01-05"))),
               c("2012-01-01", "2012-01-02", "2012-01-03", "2012-01-05"))
})

Try the messydates package in your browser

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

messydates documentation built on Jan. 22, 2023, 1:36 a.m.