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

Refactor encoding test helpers and use withr::local_locale() #5236

Merged
merged 3 commits into from
May 13, 2020

Conversation

jennybc
Copy link
Member

@jennybc jennybc commented May 12, 2020

Alternative to #5231. withr does have support for locale change, so I used that + some probing for a non-UTF-8 locale.

"en_US.ISO8859-1",
"en_US.ISO8859-15",
"fr_CH.ISO8859-1",
"fr_CH.ISO8859-15"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add more if we see skips on a system where there are non-UTF-8 locales available.

Copy link
Member

@romainfrancois romainfrancois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I think I confused myself to not use withr:: because we don't use it in the code and only Suggests it, but that's nicer.

closes #5231

@jennybc
Copy link
Member Author

jennybc commented May 12, 2020

I saw withr is already used elsewhere below tests/ so I figured it was fair game.

@jennybc jennybc merged commit d9e0116 into master May 13, 2020
@jennybc jennybc deleted the local-non-utf8-encoding branch May 13, 2020 14:15
@@ -53,7 +53,9 @@ DataMask <- R6Class("DataMask",

promises <- map(seq_len(ncol(data)), function(.x) expr(promise_fn(!!.x)))

env_bind_lazy(private$bindings, !!!set_names(promises, names_bindings))
suppressWarnings(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me feel anxious.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it needs a comment about the kind of anticipated warnings. Also if this needs to be fixed here it might need to be fixed upstream.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from @romainfrancois. I had asked a similar question in slack.

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.

3 participants