quanteda / readtext

an R package for reading text files
https://readtext.quanteda.io
120 stars 28 forks source link

Inconsistent order of files on Mac and Linux #135

Closed koheiw closed 6 years ago

koheiw commented 6 years ago

This test cannot pass on Travis because the order of the files is OS dependent.

https://github.com/quanteda/readtext/blob/b32818f5293ebfe9b6dac3b50d9ba97b23e8eaa9/tests/testthat/test-readtext.R#L637-L640

Linux

> Sys.glob("~/packages/readtext/tests/data/json/*json")
[1] "/home/kohei/packages/readtext/tests/data/json/test2.json" "/home/kohei/packages/readtext/tests/data/json/test3.json"
[3] "/home/kohei/packages/readtext/tests/data/json/test.json"

MacOS

> Sys.glob("./tests/data/json/*json")
[1] "./tests/data/json/test.json"  "./tests/data/json/test2.json"
[3] "./tests/data/json/test3.json"

We need to sort the output of Sys.glob().