tests/testthat/test-tsl_time.R

test_that("`tsl_time()` works", {

  tsl <- tsl_simulate(
    n = 3,
    rows = 150,
    time_range = c(Sys.Date() -
    365, Sys.Date()),
    irregular = TRUE
    )

  df <- tsl_time(tsl = tsl)

  expect_equal(class(df), "data.frame")
  expect_equal(nrow(df), length(tsl))
  expect_true(all(df$name ==  tsl_names_get(tsl)))

})

Try the distantia package in your browser

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

distantia documentation built on April 4, 2025, 5:42 a.m.