File: test-format_time.R

package info (click to toggle)
r-cran-pillar 1.8.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,840 kB
  • sloc: sh: 13; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 463 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
test_that("output test", {
  expect_snapshot({
    pillar(add_special(as.POSIXct("2017-07-28 18:04:35 +0200")))
    pillar(add_special(as.POSIXlt("2017-07-28 18:04:35 +0200")))
  })
  withr::with_options(
    list(digits.secs = 4),
    expect_snapshot({
      pillar(add_special(as.POSIXlt("2017-07-28 18:04:35 +0200")))
    })
  )

  testthat::skip_if(getRversion() < "3.3")
  expect_snapshot({
    pillar(add_special(as.difftime(8:11, units = "secs")))
  })
})