tests/testthat/test-function-hsTsBefore.R

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

test_that("hsTsBefore() works", {

  expect_error(
    kwb.datetime:::hsTsBefore(tstamps = 1, tsLimit = 1)
    # datetime is not of one of the supported classes 'character', 'Date', 'POSIXt'
  )
   expect_error(
    kwb.datetime:::hsTsBefore(tstamps = "a", tsLimit = 1)
    # character string is not in a standard unambiguous format
  )
   expect_error(
    kwb.datetime:::hsTsBefore(tstamps = as.POSIXct("2018-06-03 23:50:00"), tsLimit = 1)
    # replacement has length zero
  )

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