Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update locale in test.data.table #4630

Merged
merged 3 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

## BUG FIXES

1. `test.data.table()` could fail the 2nd time it is run by a user in the same R session on Windows due to not resetting locale properly after testing Chinese translation, [#4630](https://github.com/Rdatatable/data.table/pull/4630). Thanks to Cole Miller for investigating and fixing.

## NOTES

1. `bit64` v4.0.2 released on 30th July broke `data.table`'s tests. It seems that reverse dependency testing of `bit64` (i.e. testing of the packages which use `bit64`) did not include `data.table` because `data.table` merely suggests `bit64` and does not depend on it. Like other packages on our `Suggest` list, we test `data.table` works with `bit64` in our tests. In testing of our own reverse dependencies (packages which use `data.table`) we do include packages which suggest `data.table`, although it appears it is not CRAN policy to do so. We have requested that CRAN policy be changed to include suggests in reverse dependency testing.
Expand Down
9 changes: 3 additions & 6 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -16970,19 +16970,16 @@ if (.Platform$OS.type=="windows") local({
LC_NUMERIC = "C",
LC_TIME = "Chinese (Simplified)_China.936"
)
for (i in seq_along(x)) {
lc = names(x)[[i]]
old = Sys.getlocale(lc)
Sys.setlocale(lc, x[[i]])
on.exit(Sys.setlocale(lc, old), add = TRUE)
}
x_old = Map(Sys.getlocale, names(x))
invisible(Map(Sys.setlocale, names(x), x))
old = Sys.getenv('LANGUAGE')
Sys.setenv('LANGUAGE' = 'zh_CN')
on.exit({
if (nzchar(old))
Sys.setenv('LANGUAGE' = old)
else
Sys.unsetenv('LANGUAGE')
invisible(Map(Sys.setlocale, names(x_old), x_old))
}, add = TRUE)
# triggered segfault here in #4402, Windows-only under translation.
# test that the argument order changes correctly (the 'item 2' moves to the beginning of the message)
Expand Down