Debian Codegraph @

tests/testthat/test_print_Appender.R

raw
1 context("print_Appender")
2
3
4
5
6 test_that("all Appenders print() without failure", {
7 skip_if_not_installed("rotor")
8
9 tf <- tempfile()
10 on.exit(unlink(tf))
11
12 expect_output({
13 print(Appender$new())
14 print(AppenderConsole$new())
15 print(AppenderConsole$new(layout = LayoutGlue$new()))
16 print(AppenderBuffer$new(appenders = list(
17 AppenderConsole$new(),
18 blah = AppenderBuffer$new()
19 )))
20 print(AppenderFileRotating$new(tf))
21 print(AppenderFileRotating$new(tf, size = "1kb"))
22 app <- AppenderFileRotatingDate$new(tf, layout = LayoutJson$new())
23 app$rotate(force = TRUE)
24 print(app)
25 app$prune(0)
26
27 print(AppenderFileRotatingTime$new(
28 tf,
29 layout = LayoutJson$new(),
30 age = "2 years",
31 size = 90000)
32 )
33 print(AppenderFile$new(tf))
34 })
35 })