Debian Codegraph @

tests/testthat/test-caution.R

raw
1
2 test_that("bulletin() creates bulleted list with optional postamble", {
3 expect_snapshot({
4 bulletin("preamble", letters[1:3])
5 bulletin("preamble", letters[1:3], postamble = "after")
6 })
7 })
8
9 test_that("bulletin() doesn't show pre/post amble if no values", {
10 expect_silent(bulletin("before", character(), "after"))
11 })
12
13 test_that("options(renv.pretty.print.emitter) is respected", {
14
15 skip_on_cran()
16 project <- renv_tests_scope("bread")
17 init()
18
19 cls <- "renv.pretty.print.emitter"
20 emitter <- function(text) renv_condition_signal(cls)
21 renv_scope_options(renv.pretty.print.emitter = emitter)
22 renv_scope_options(renv.verbose = TRUE)
23
24 # regular pretty printer
25 expect_condition(bulletin("preamble", 1), class = cls)
26
27 # record printer
28 lockfile <- renv_lockfile_create(project = getwd())
29 records <- renv_lockfile_records(lockfile)
30 expect_condition(renv_pretty_print_records(NULL, records), class = cls)
31
32 # diff printer
33 expect_condition(renv_pretty_print_records_pair(NULL, records, records))
34
35 })