tests/testthat/test-title.R

test_that("with and without title", {
  expect_snapshot({
    pillar(add_special(10^(1:6)))
    pillar(add_special(10^(1:6)), title = "crayon")
    pillar(add_special(10^(1:6)), title = "short")
    pillar(add_special(10^(1:6)), title = "somewhat_wider")
    pillar(add_special(10^(1:6)), title = "exactly_fifteen")
    pillar(add_special(10^(1:6)), title = "absolutely_breaking_all_sensible_boundaries", width = 18)
  })
})

test_that("ellipsis has width 1", {
  expect_equal(get_extent(get_ellipsis()), 1)
})

Try the pillar package in your browser

Any scripts or data that you put into this service are public.

pillar documentation built on March 31, 2023, 10:19 p.m.