File: test-headers.R

package info (click to toggle)
r-cran-cli 3.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,288 kB
  • sloc: ansic: 16,412; cpp: 37; sh: 13; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 565 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
20
21
22

start_app()
on.exit(stop_app(), add = TRUE)

test_that_cli("headers", {
  expect_snapshot(local({
    cli_div(class = "testcli", theme = test_style())
    cli_h1("HEADER")
    cli_h2("Header")
    cli_h3("Header")
    x <- "foobar"
    xx <- 100
    cli_h2("{xx}. header: {x}")
  }), variant = if (packageVersion("testthat") <= "3.1.4") "old" else "new")
})

test_that("issue #218", {
  expect_snapshot({
    cli_h1("one {1} two {2} three {3}")
    cli_h2("one {1} two {2} three {3}")
  }, variant = if (packageVersion("testthat") <= "3.1.4") "old" else "new")
})