expectRaw-tag {doctest}R Documentation

Create an expectation as-is

Description

⁠@expectRaw⁠ creates an expectation for your example code, without adding the next expression as the subject.

Details

⁠@expectRaw⁠ creates a testthat expectation. Unlike @expect, it doesn't insert the subsequent expression as the first argument.

#' @doctest
#'
#' x <- 2 + 2
#' @expectRaw equals(x, 4)
#'
#' f <- function () warning("Watch out")
#' @expectRaw warning(f())

Don't include the expect_ prefix.

The ⁠@expectRaw⁠ tag and code must fit on a single line.

See Also

Other expectations: expect-tag, snap-tag


[Package doctest version 0.3.0 Index]