tests/testthat/test-format_numeric.R
raw| 1 | test_that("same pillar at different widths", { |
| 2 | v <- 10^c(-5, -2, 3, 6) |
| 3 | x <- pillar(v) |
| 4 | expect_equal(get_min_width(x$data), 4) |
| 5 | expect_equal(get_width(x$data), 13) |
| 6 | expect_snapshot({ |
| 7 | pillar(v, width = 4) |
| 8 | pillar(v, width = 7) |
| 9 | pillar(v, width = 10) |
| 10 | pillar(v, width = 15) |
| 11 | pillar(v, width = 22) |
| 12 | }) |
| 13 | }) |