-
Notifications
You must be signed in to change notification settings - Fork 240
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
Skip non-ASCII tests if system does not support UTF-8 #749
Conversation
…h a non-ASCII character string and one test with a non-ASCII variable name * Non-ASCII character strings should work on all platforms * Non-ASCII variable names should only work on platforms with UTF-8 support
Okay, I've done some investigating on a non-UTF-8 Windows build, and here's what's going on: The failing test involves the This particular failing test occurred in a case where the code contains non-ASCII character but shouldn't return an error: it assigned a non-ASCII character vector to a non-ASCII (Greek) variable name, which is a valid operation. However, non-ASCII variable names can only be used on platforms with UTF-8 support. To fix this, I've split the test into two tests. The non-ASCII character vector is tested on all platforms: it shouldn't produce a parse error on any system, since you can use Unicode characters in strings even on non-UTF-8 platforms. The non-ASCII variable name is now only tested on non-Windows platforms with UTF-8 support, since that will cause a parse error on non-UTF-8 systems. I've tested this locally on Windows R 3.6.3 (no UTF-8 support) and non-UTF-8 Debian on R-hub with no errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed investigation and the fix!
* fix: skip non-ASCII tests is system does not support UTF-8 * test(exercise_check_unparsable_unicode): split test into one test with a non-ASCII character string and one test with a non-ASCII variable name * Non-ASCII character strings should work on all platforms * Non-ASCII variable names should only work on platforms with UTF-8 support
Previously, tests that involved non-ASCII text were skipped on Windows, with the assumption that all Unix builds of R support UTF-8. Tests now explicitly check if the system supports UTF-8 to avoid a CRAN failure on non-Unicode Unix builds. This fix is confirmed working on rhub's debian-clang-devel platform, which forces a Latin-1 (non-UTF-8) locale.
Closes #748.