fail: Default expectations that alway succeed or fail.

Description Usage Arguments Examples

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

1
2
3
fail(message = "Failure has been forced")

succeed(message = "Success has been forced")

Arguments

message

a string to display.

Examples

1
2
3
4
5
## Not run: 
test_that("this test fails", fail())
test_that("this test succeeds", succeed())

## End(Not run)


Search within the testthat package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.