Skip to content

Commit

Permalink
YA catch Sys.setLanguage() warning
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87053 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
maechler committed Aug 26, 2024
1 parent 4426167 commit f8530e9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/reg-tests-1e.R
Original file line number Diff line number Diff line change
Expand Up @@ -1485,11 +1485,10 @@ M <- alist(.=)$.
stopifnot(missing(M))
try( M ) # --> Error: argument "M" is missing, with no default (typically English)
ls.str(pattern = "^M$") # (typically:) M : <missing>
(oL <- Sys.setLanguage("de"))
try( M ) # --> Error : Argument "M" fehlt (ohne Standardwert)
(oL <- tryCatch(Sys.setLanguage("de"), warning = identity, error = identity))
try( M ) # in good case --> Error : Argument "M" fehlt (ohne Standardwert)
(out <- capture.output(ls.str(pattern = "^M$")))
# reset LANGUAGE, etc where needed (and see effect):
rm(M); if(attr(oL,"ok")) Sys.setLanguage(oL)
rm(M); if(attr(oL,"ok")) Sys.setLanguage(oL) # reset LANGUAGE etc
stopifnot(endsWith(out, "<missing>"))
## failed in R <= 4.4.1; out was "M : Argument \"M\" fehlt <...>"

Expand Down

0 comments on commit f8530e9

Please sign in to comment.