Skip to content

fix: skip non-ASCII path tests when locale lacks UTF-8 support - #629

Closed
LeonidasZhak wants to merge 1 commit into
tidyverse:mainfrom
LeonidasZhak:fix/test-path-locale-skip-guards
Closed

LeonidasZhak wants to merge 1 commit into
tidyverse:mainfrom
LeonidasZhak:fix/test-path-locale-skip-guards

Conversation

@LeonidasZhak

Copy link
Copy Markdown

What

Four tests in test-path.R use Unicode characters in tempfile() patterns but fail on systems where the locale is C (no UTF-8 support), because tempfile() cannot translate the patterns to the native encoding.

This PR adds skip_if(!l10n_info()$UTF-8) guards to these tests:

  • can read file w/o final newline, w/ multi-byte characters in path
  • can read file w/ final newline, w/ multi-byte characters in path
  • can write to path with non-ascii characters
  • can read fwf file w/ non-ascii characters in path

Also updates _snaps/path.md to match current lifecycle 1.0.5.9000 wording (in vroom 1.5.0 instead of as of vroom 1.5.0).

Why

On macOS (and other systems) with LANG=C or LC_CTYPE=C, these tests fail with:

unable to translate 'no-trailing-nèwline-mülti-byté-path-' to native encoding

The sibling test at line 184 already has a locale guard (skip_if(l10n_info()$Latin-1)), but the four affected tests had none.

Validation

Rscript -e 'devtools::test()'
# FAIL 0 | WARN 0 | SKIP 9 | PASS 1159

All 4 previously-failing tests now correctly skip on non-UTF-8 locales.

Four tests in test-path.R use Unicode characters in tempfile patterns
but fail on systems where the locale is C (no UTF-8 support), because
tempfile() cannot translate the patterns to the native encoding.

Add skip_if(!l10n_info()$`UTF-8`) guards to these tests:
- can read file w/o final newline, w/ multi-byte characters in path
- can read file w/ final newline, w/ multi-byte characters in path
- can write to path with non-ascii characters
- can read fwf file w/ non-ascii characters in path

Also update _snaps/path.md to match current lifecycle 1.0.5.9000
wording ('in vroom 1.5.0' instead of 'as of vroom 1.5.0').
@LeonidasZhak

Copy link
Copy Markdown
Author

I am withdrawing this PR as part of a broader cleanup of an oversized automated contribution batch. I am sorry for the review noise and the pressure this may have put on maintainers. Going forward I will keep contributions to this project much more limited and higher-signal, ideally only one or two focused PRs at a time. Thank you for maintaining the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant