ExpectNoWarning: ExpectNoWarning

View source: R/warnings.R

ExpectNoWarningR Documentation

ExpectNoWarning

Description

Checks to see if the printing of an object does not cause a warning to appear.

Usage

ExpectNoWarning(code, string)

Arguments

code

The code to evaluate for warnings.

string

The string of text to be searched for in the warnings

Value

Returns NULL. Throws an exception if the code is evaluated and the string appears in the warning.

Examples

throwsAWarning <- function()
{
    warning("This is a warning")
}
ExpectNoWarning(throwsAWarning(), "different warning")

Displayr/flipU documentation built on March 2, 2024, 4:35 a.m.