expect {testthat} | R Documentation

## The building block of all `expect_` functions

### Description

Call this function when writing your own expectations. See `vignette("custom-expectation")` for details.

### Usage

    expect(ok, failure_message, info = NULL, srcref = NULL)

### Arguments

`ok` | `TRUE` or `FALSE` indicating if the expectation was successful.
`failure_message` | Message to show if the expectation failed.
`info` | Character vector continuing additional information. Included for backward compatibility only and new expectations should not use it.
`srcref` | Location of the failure. Should only needed to be explicitly supplied when you need to forward a srcref captured elsewhere.

### Value

An expectation object. Signals the expectation condition with a `continue_test` restart.

[Package testthat version 2.1.1 Index]