Skip to content

Commit d4efe5b

Browse files
Add a test
1 parent 0d14e91 commit d4efe5b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/testthat/test-public_api.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,21 @@ test_that("messages (via cat()) of style_file are correct", {
194194
}
195195
})
196196

197+
test_that("Messages can be suppressed", {
198+
for (encoding in ls_testable_encodings()) {
199+
withr::with_options(
200+
list(cli.unicode = encoding == "utf8", styler.quiet = TRUE),
201+
{
202+
output <- catch_style_file_output(c(
203+
"public-api", "xyzdir-dirty", "dirty-sample-with-scope-spaces.R"
204+
), encoding = encoding)
205+
print(output)
206+
expect_equal(output, character(0))
207+
}
208+
)
209+
}
210+
})
211+
197212
context("public API - Rmd in style_dir()")
198213

199214
test_that("styler can style R and Rmd files via style_dir()", {

0 commit comments

Comments
 (0)