Package: doctest 0.4.0

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.0.tar.gz
doctest_0.4.0.zip(r-4.7)doctest_0.4.0.zip(r-4.6)doctest_0.4.0.zip(r-4.5)
doctest_0.4.0.tgz(r-4.6-any)doctest_0.4.0.tgz(r-4.5-any)
doctest_0.4.0.tar.gz(r-4.7-any)doctest_0.4.0.tar.gz(r-4.6-any)
doctest_0.4.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
doctest/json (API)
NEWS

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

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

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

On CRAN:

Conda:

6.45 score 31 stars 3 scripts 430 downloads 2 exports 35 dependencies

Last updated from:ef97b06623 (on v0.4.0). Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK142
source / vignettesOK157
linux-release-x86_64OK170
macos-release-arm64OK97
macos-oldrel-arm64OK94
windows-develOK137
windows-releaseOK80
windows-oldrelOK69
wasm-releaseOK112

Exports:dt_roclettest_doctests

Dependencies:brewbriocallrclicommonmarkcpp11crayondescdiffobjevaluatefsgluehighrjsonliteknitrlifecyclemagrittrotelpkgbuildpkgloadpraiseprocessxpspurrrR6rlangroxygen2rprojroottestthatvctrswaldowithrxfunxml2yaml

Converting a package to use doctest

Rendered fromconversion.Rmdusingknitr::rmarkdownon Jun 19 2026.

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

doctest

Rendered fromdoctest.Rmdusingknitr::rmarkdownon Jun 19 2026.

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