testRaw-tag {doctest}R Documentation

Add a line of code to the test

Description

⁠@testRaw⁠ adds an arbitrary line of code to your test, without including it in the .Rd example.

Details

⁠@testRaw⁠ adds an arbitrary line of code to your test:

#' @doctest
#' @testRaw skip_on_cran("Takes too long")
#' @expect equal(6765)
#' fibonacci(20)

Unless your doctest has at least one @expect or @expectRaw tag, no test will be created. So use those tags, not ⁠@testRaw⁠, to add expectations.

Remember that the main purpose of examples is to document your package for your users. If your code is getting too different from your example, consider splitting it off into a proper test file. To do this, rename the file in tests/testthat, and deleting the ⁠Generated by doctest⁠ comment.


[Package doctest version 0.3.0 Index]