tests/testthat/test-function-minTimeStep.R

#
# This test file has been generated by kwb.test::create_test_files()
#

test_that("minTimeStep() works", {

  kwb.datetime:::minTimeStep(tstamps = 1:2)
   kwb.datetime:::minTimeStep(tstamps = c("a", "b"))
   expect_error(
    kwb.datetime:::minTimeStep(tstamps = 1)
    # At least two timestamps needed, tstamps has only1
  )
   expect_error(
    kwb.datetime:::minTimeStep(tstamps = list(key = c("a", "b"), value = 1:2))
    # (list) object cannot be coerced to type 'integer'
  )

})
KWB-R/kwb.datetime documentation built on July 9, 2021, 10:28 p.m.