R: Default expectations that always succeed or fail.

fail {testthat} | R Documentation

## Default expectations that always succeed or fail.

### Description

These allow you to manually trigger success or failure. Failure is particularly useful to a pre-condition or mark a test as not yet implemented.

### Usage

    fail(message = "Failure has been forced", info = NULL)

    succeed(message = "Success has been forced", info = NULL)

### Arguments

`message` | a string to display.
`info` | Character vector continuing additional information. Included for backward compatibility only and new expectations should not use it.

### Examples

    ## Not run:
    test_that("this test fails", fail())
    test_that("this test succeeds", succeed())

    ## End(Not run)

[Package testthat version 2.2.1 Index]