Reference files allow to check if results are correct. They are not just a copy of the result files. They are reencoded to avoid someone could just copy and paste from the reference to the results directories and cheat.

make_ref(
  name,
  ...,
  dir1 = here::here("tests", "results"),
  dir2 = here::here("tests", "reference"),
  nthreads = parallel::detectCores(logical = FALSE)
)

read_ref(
  name,
  ...,
  dir = here::here("tests", "reference"),
  nthreads = parallel::detectCores(logical = FALSE)
)

Arguments

name

Name of the result file to transform into a reference file

...

Further parameters passed to qs::qread()

dir1

Directory containing the result file

dir2

Directory where to place the reference file

nthreads

Number of threads to use for reading or writing the files

dir

Directory containing the reference file

Value

The decoded content of the result file for read_ref() or the number of bytes written for make_ref().