Public-Health-Scotland / phsmethods

An R package to standardise methods used in Public Health Scotland (https://public-health-scotland.github.io/phsmethods/)
https://public-health-scotland.github.io/phsmethods/
54 stars 13 forks source link

Fix the file size test #105

Closed Moohan closed 9 months ago

Moohan commented 10 months ago

I added some tests to file_size, these were reporting fine but failed on Windows as the text file was read to be larger than it had been on Linux (PWB).

This answer describes the issue - https://www.unix.com/.../41059-file-size-different-unix-windows.html

My solution is to check the OS the test is running on (Windows or not) and create a specific snapshot based on that. This means there will still be a difference in the reported file size between Windows/non-Windows but the test will be useful to see if anything else changes accidentally.