swirldev / swirl

:cyclone: Learn R, in R.
http://swirlstats.com
Other
1.13k stars 593 forks source link

tests appear to require en_US.UTF-8 #533

Open dgoerger opened 8 years ago

dgoerger commented 8 years ago

I'm working to package swirl for Fedora, and appear to have stumbled across an interesting locale requirement for the tests/testthat/test-encoding.R test. Namely I've had to append export LC_ALL="en_US.UTF-8" to the rpm specfile (by default mock only exports LANG="en_US.UTF-8), or building produces the following error:

* checking tests ...
  Running 'test-all.R'
 ERROR
Running the tests in 'tests/test-all.R' failed.
Last 13 lines of output:
  stri_escape_unicode(test_phrase) not equal to stri_escape_unicode("\344\270\255\346\226\207\346\270\254\350\251\246").
  1/1 mismatches
  x[1]: "<U+4E2D><U+6587><U+6E2C><U+8A66>"
  y[1]: "\\ufffd\\ufffd\\ufffd\\ufffd\\ufffd\\ufffd\\ufffd\\ufffd\\ufffd\\ufffd\\u
  y[1]: fffd\\ufffd"

  testthat results ================================================================
  OK: 13 SKIPPED: 0 FAILED: 1
  1. Failure: Trying to parse the test-encoding.yaml (@test-encoding.R#27) 

  Error: testthat unit tests failed
  Execution halted
* checking PDF version of manual ... OK
* DONE
Status: 1 ERROR, 2 WARNINGs

This may or may not be feasible to work around (I'm guessing it has stringi and testthat dependencies, but haven't dug too deeply), but it's a weird enough error that I wanted to document it.

seankross commented 8 years ago

Hi @dgoerger,

I agree that this is a problematic test, thanks for reporting this.