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

test that variables defined after a function may be used within the function #331

Merged
merged 2 commits into from
Nov 5, 2018

Conversation

schloerke
Copy link
Collaborator

Test for #330

@schloerke
Copy link
Collaborator Author

Test will fail as the current implementation of this branch is faulty.

@schloerke schloerke merged commit 1b78a19 into rstudio:master Nov 5, 2018
@schloerke schloerke deleted the source_file branch November 5, 2018 14:45
schloerke added a commit to schloerke/plumber that referenced this pull request Nov 5, 2018
schloerke added a commit that referenced this pull request Nov 6, 2018
* The source files used in plumber must use the UTF-8 encoding if they contain
non-ASCII characters

* comments

* display appveyor local

* try in install script

* chinese only

* top level scripts only

* no cache

* use testthat::test_path when providing relative test files

* add sourceUTF8 and helper functions from shiny

This stems from wanting to read utf8 files on a non utf8 locale.  On windows, the locale is set to the system default which typically does not support utf8 out of the box.

sourceUTF8 functions are adopted form the rstudio/shiny repo in an effort to use code that has already be validated to work.

The ending finding is that `source(file, encoding="UTF-8")` does not work as expected and instead should use `eval(parse(file, encoding = "UTF-8"))`

* remove appveyor file as locale / utf8 can be tested on travis

* add second PR to news item

* add note for why sourcing is done

* add note about keeping the source location when parsing

* Evalauate all file expression blocks only once, not once or twice

Fixes tests made in #331

* activateBlock -> evaluateBlock

* add comments about LC_ALL and use charToRaw to test UTF-8 strings

* minimize travis crand and github pkg downloads

* remove travis comments

* added news item about sourcing code only once

* bold **must use**

* add default appveyor


Co-authored-by: Xianying Tan <shrektan@126.com>
Co-authored-by: Barret Schloerke <schloerke@gmail.com>
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.

None yet

2 participants