Learn R Programming

testthat (version 0.11.0)

expect_silent: Expect that code has no output, messages, or warnings.

Description

Expect that code has no output, messages, or warnings.

Usage

expect_silent(expr)

Arguments

expr
Expression to evaluate

See Also

Other expectations: equivalence, expect_equal, expect_equivalent, expect_identical; expect-compare, expect_gt, expect_gte, expect_less_than, expect_lt, expect_lte, expect_more_than; expect_equal_to_reference; expect_error, expect_match, expect_message, expect_output, expect_warning, matching-expectations; expect_false, expect_true; expect_is; expect_named; expect_null; takes_less_than

Examples

Run this code
expect_silent("123")

f <- function() {
  message("Hi!")
  warning("Hey!!")
  print("OY!!!")
}
expect_silent(f())

Run the code above in your browser using DataLab