Skip to content

Commit ec545e9

Browse files
committed
fix toString.LogEvent test
1 parent ea0fba3 commit ec545e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/testthat/test_print_LogEvent.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,14 @@ test_that("toString.LogEvent works as expected", {
6767
letters = letters
6868
)
6969

70-
toString(x)
70+
expect_length(toString(x), 1L)
71+
# just a rudimentary check because exact representation depends on console width
72+
expect_match(toString(x), "level.*letters")
7173
})
7274

7375

76+
77+
7478
test_that("toString.LogEvent without custom fields does not end in whitespace", {
7579
event_without_field <- LogEvent$new(
7680
logger = lgr::lgr,

0 commit comments

Comments
 (0)