#
# This test file has been generated by kwb.test::create_test_files()
#
test_that("resetTimePart() works", {
kwb.datetime:::resetTimePart(tstamp = as.POSIXct("2018-06-03 23:50:00"), resetHour = 1)
kwb.datetime:::resetTimePart(tstamp = as.POSIXct("2018-06-03 23:50:00"), resetHour = 1:2)
kwb.datetime:::resetTimePart(tstamp = as.POSIXct("2018-06-03 23:50:00"), resetHour = "a")
kwb.datetime:::resetTimePart(tstamp = as.POSIXct("2018-06-03 23:50:00"), resetHour = c("a", "b"))
kwb.datetime:::resetTimePart(tstamp = as.POSIXct("2018-06-03 23:50:00"), resetHour = TRUE)
kwb.datetime:::resetTimePart(tstamp = as.POSIXct("2018-06-03 23:50:00"), resetHour = FALSE)
expect_error(
kwb.datetime:::resetTimePart(tstamp = 1, resetHour = 1)
# invalid 'trim' argument
)
expect_error(
kwb.datetime:::resetTimePart(tstamp = 1, resetHour = as.POSIXct("2018-06-03 23:50:00"))
# 'any' not defined for "POSIXt" objects
)
expect_error(
kwb.datetime:::resetTimePart(tstamp = 1, resetHour = list(key = c("a", "b"), value = 1:2))
# (list) object cannot be coerced to type 'logical'
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.