tests/test-ci/test-base64.R

library(testit)

assert('.mime_cmd() works', {
  # test some common file types
  fs = list.files(R.home('doc'), '[.](html|pdf|png)$', recursive = TRUE, full.names = TRUE)
  fs = fs[!duplicated(file_ext(fs))]
  m = list(html = 'text/html', pdf = 'application/pdf', png = 'image/png')
  types = unname(m[file_ext(fs)])
  (lapply(fs, .mime_cmd) %==% types)
  (!is_windows() || lapply(fs, .mime_cmd, use_file = FALSE) %==% types)
})

Try the xfun package in your browser

Any scripts or data that you put into this service are public.

xfun documentation built on Nov. 1, 2024, 1:06 a.m.