tests/testthat/test-function-startsToEnds.R

test_that("startsToEnds() works", {
  
  starts <- c(1, 10, 20, 35)
  
  expect_identical(startsToEnds(starts, lastStop = 50), c(9, 19, 34, 50))
  
  expect_identical(
    startsToEnds(starts, lastStop = 50, stopOffset = 2), 
    c(8, 18, 33, 50)
  )
})
KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.