Package: doctest 0.4.1

David Hugh-Jones

doctest: Generate Tests from Examples Using 'roxygen' and 'testthat'

Creates 'testthat' tests from 'roxygen' examples using simple tags.

Authors:David Hugh-Jones [aut, cre]

doctest_0.4.1.tar.gz
doctest_0.4.1.zip(r-4.7-any)doctest_0.4.1.zip(r-4.6-any)doctest_0.4.1.zip(r-4.5-any)
doctest_0.4.1.tgz(r-4.6-any)doctest_0.4.1.tgz(r-4.5-any)
doctest_0.4.1.tar.gz(r-4.7-any)doctest_0.4.1.tar.gz(r-4.6-any)
doctest_0.4.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
doctest/json (API)

# Install 'doctest' in R:
install.packages('doctest', repos = c('https://community.r-multiverse.org', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/hughjonesd/doctest/issues

Pkgdown/docs site:https://hughjonesd.github.io

On CRAN:

Conda:

6.65 score 31 stars 3 scripts 1.2k downloads 2 exports 35 dependencies

Last updated from:7c66bdbe63 (on v0.4.1). Checks:9 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-develOK138
source / vignettesOK196
linux-releaseOK132
macos-releaseOK96
macos-oldrelOK76
windows-develOK71
windows-releaseOK91
windows-oldrelOK74
wasm-releaseOK125

Exports:dt_roclettest_doctests

Dependencies:brewbriocallrclicommonmarkcpp11crayondescdiffobjevaluatefsgluehighrjsonliteknitrlifecyclemagrittrotelpkgbuildpkgloadpraiseprocessxpspurrrR6rlangroxygen2rprojroottestthatvctrswaldowithrxfunxml2yaml

Converting a package to use doctest
Setting up doctest | Converting @examples to @doctest sections | Before | After | Creating doctests by adding expectations | Doctests for messaging functions | Adding doctests for utility functions | Adding doctest to Suggests: | Conclusion

Last update: 2025-12-04
Started: 2022-12-14

doctest
Introduction to doctest | Adding doctests to your package | Tags | @doctest | @expect | @expectRaw | @snap | @testRaw | @omit and @resume | @doctestExample | Caveats | Writing good doctests | Related packages

Last update: 2023-04-28
Started: 2022-11-25

Readme and manuals

Help Manual

Help pageTopics
Write testthat tests for your examples, using roxygen tagsdoctest-package doctest
Start a doctest@doctest doctest-tag
Add an example from a file@doctestExample doctestExample-tag
Create the doctest rocletdt_roclet
Create an expectation@expect expect-tag
Create an expectation as-is@expectRaw expectRaw-tag
Exclude example code from a test@omit @resume omit-tag resume-tag
Create a snapshot test@snap snap-tag
Test doctests in a packagetest_doctests
Add a line of code to the test@testRaw testRaw-tag