Learn R Programming

doctest (version 0.4.0)

expectRaw-tag: Create an expectation as-is

Description

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

Arguments

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