tests/testthat/test_POSIX.R

library(GGIR)
context("POSIX")
options(encoding = "UTF-8")
test_that("g.impute returns a non-empty dataframe", {
  # POSIXtime2iso8601
  x ="2017-05-07 13:15:17 CEST"
  tz = "Europe/Amsterdam"
  x_converted = POSIXtime2iso8601(x,tz)
  expect_equal(as.character(x_converted),"2017-05-07T13:15:17+0200")
  
  # iso8601chartime2POSIX
  x ="2017-05-07T13:00:00+0200"
  tz = "Europe/Amsterdam"
  x_converted = iso8601chartime2POSIX(x,tz)
  expect_equal(as.character(x_converted),"2017-05-07 13:00:00")
})
PeteJWatson/ggircal documentation built on Nov. 24, 2021, 11:14 a.m.