tests/testit/test-citation.R

library(testit)

pkgs = c(rownames(installed.packages(priority = 'high')), 'evaluate', 'knitr')
write_bib(pkgs, tempfile(), tweak = FALSE)

assert(
  '& is escaped in title when write_bib(tweak = TRUE)',
  length(grep(' & ', grep(
    '^  title =', capture.output(write_bib(pkgs, tweak = TRUE)), value = TRUE
  ))) == 0
)

Try the knitr package in your browser

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

knitr documentation built on Nov. 2, 2023, 5:49 p.m.