File: test-utils.R

package info (click to toggle)
r-cran-clock 0.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,856 kB
  • sloc: cpp: 19,565; sh: 17; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 635 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
test_that("POSIXt time zones are standardized as expected", {
  expect_identical(posixt_tzone_standardize(NULL), "")
  expect_identical(posixt_tzone_standardize(""), "")
  expect_identical(posixt_tzone_standardize("America/New_York"), "America/New_York")

  # POSIXlt can return something like this
  expect_identical(posixt_tzone_standardize(c("", "EST", "EDT")), "")

  # Unknown if this can happen, but we handle it anyways
  expect_snapshot(posixt_tzone_standardize(character()))
  expect_warning(
    expect_identical(posixt_tzone_standardize(character()), "")
  )

  expect_snapshot(error = TRUE, posixt_tzone_standardize(1))
})