R Under development (unstable) (2024-04-23 r86473 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(testthat) > library(cliapp) > > ## Run the tests in fancy mode and non-fancy mode as well > ## Also, run them in latin1 encoding as well, this is for Unix, > ## because Windows encoding names are different. > > withr::with_options( + list(cli.unicode = FALSE), + test_check("cliapp") + ) [ FAIL 0 | WARN 0 | SKIP 0 | PASS 134 ] > > withr::with_options( + list(cli.unicode = TRUE), + test_check("cliapp") + ) [ FAIL 0 | WARN 0 | SKIP 0 | PASS 134 ] > > has_locale <- function(l) { + has <- TRUE + tryCatch( + withr::with_locale(c(LC_CTYPE = l), "foobar"), + warning = function(w) has <<- FALSE, + error = function(e) has <<- FALSE + ) + has + } > > if (l10n_info()$`UTF-8` && has_locale("en_US.ISO8859-1")) { + withr::with_locale( + c(LC_CTYPE = "en_US.ISO8859-1"), + test_check("cliapp") + ) + } > > proc.time() user system elapsed 28.04 0.85 40.06