File: test-tbl-format-header.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 (19 lines) | stat: -rw-r--r-- 553 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
test_that("tbl_format_header() results", {
  local_unknown_rows()
  local_foo_tbl()

  expect_snapshot({
    tbl_format_header(tbl_format_setup(as_tbl(mtcars), width = 80))

    tbl_format_header(tbl_format_setup(as_unknown_rows(trees), width = 30, n = 10))

    "Narrow"
    tbl_format_header(tbl_format_setup(as_tbl(mtcars), width = 10))

    "Custom tbl_sum()"
    tbl_format_header(tbl_format_setup(new_foo_tbl(), width = 30))

    "Focus columns"
    tbl_format_header(tbl_format_setup(new_tbl(trees, pillar_focus = "Volume"), width = 30))
  })
})