File: test-sitrep.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 (17 lines) | stat: -rw-r--r-- 507 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

test_that("sitrep runs", {
  expect_true(is.list(cli_sitrep()))
  expect_true(is.character(format(cli_sitrep())))
  out <- capture_output(print(cli_sitrep()))
  expect_true(all(grepl("^- ", out)))
})

test_that("get_active_symbol_set", {
  withr::with_options(list(cli.unicode = TRUE), {
    expect_true(get_active_symbol_set() %in% c("UTF-8", "RStudio (UTF-8)"))
  })
  withr::with_options(list(cli.unicode = FALSE), {
    set <- get_active_symbol_set()
    expect_equal(set, "ASCII (non UTF-8)")
  })
})