| 1 |
test_that("integer64 output will use scientific if necessary", { |
| 2 |
skip_if_not_installed("bit64") |
| 3 |
|
| 4 |
# 0 tests for NA warning too |
| 5 |
x <- bit64::as.integer64(c(0, 1e11, 1e12) + 0:2) |
| 6 |
expect_snapshot({ |
| 7 |
pillar(add_special(x), width = 6) |
| 8 |
pillar(add_special(x), width = 7) |
| 9 |
pillar(add_special(x), width = 8) |
| 10 |
pillar(add_special(x), width = 9) |
| 11 |
pillar(add_special(x), width = 10) |
| 12 |
pillar(add_special(x), width = 11) |
| 13 |
pillar(add_special(x), width = 12) |
| 14 |
pillar(add_special(x), width = 13) |
| 15 |
pillar(add_special(x), width = 14) |
| 16 |
}) |
| 17 |
}) |
| 18 |
|
| 19 |
test_that("integer64 output uses underlines correctly", { |
| 20 |
skip_if_not_installed("bit64") |
| 21 |
|
| 22 |
local_colors() |
| 23 |
|
| 24 |
expect_snapshot({ |
| 25 |
pillar(bit64::as.integer64(c(1, 10000))) |
| 26 |
}) |
| 27 |
}) |
| 28 |
|
| 29 |
test_that("nanotime works (#378)", { |
| 30 |
skip_if_not_installed("nanotime") |
| 31 |
skip_if_not_installed("vctrs", "0.4.1.9000") |
| 32 |
|
| 33 |
# 0 tests for NA warning too |
| 34 |
x <- nanotime::nanotime('2011-12-05 08:30:00.000', format = "%Y-%m-%d %H:%M:%E9S", tz = "GMT") |
| 35 |
expect_snapshot({ |
| 36 |
pillar(x, width = 16) |
| 37 |
pillar(x, width = 17) |
| 38 |
pillar(x, width = 18) |
| 39 |
pillar(x, width = 19) |
| 40 |
pillar(x, width = 20) |
| 41 |
pillar(x, width = 21) |
| 42 |
pillar(x, width = 22) |
| 43 |
pillar(x, width = 23) |
| 44 |
pillar(x, width = 24) |
| 45 |
pillar(x, width = 25) |
| 46 |
pillar(x, width = 26) |
| 47 |
}) |
| 48 |
}) |