exit_file: Stop testing (conditionally)

View source: R/tinytest.R

exit_fileR Documentation

Stop testing (conditionally)

Description

Use exit_file to exit a file with a custom message, or use exit_if to exit if one or more conditions are met. exit_if will create a message akin to messages created by stopifnot.

Usage

exit_file(msg = "")

exit_if_not(...)

Arguments

msg

[character] An optional message to print after exiting.

...

A comma-separated list of conditions.

Value

The exit message

See Also

Other test-files: build_install_test(), run_test_dir(), run_test_file(), summary.tinytests(), test_package()

Examples

exit_file("I'm too tired to test")
exit_if_not(packageVersion("tinytest")  >= "1.0.0")
## Not run: 
exit_if_not(requireNamespace("foo",quietly=TRUE))

## End(Not run)

tinytest documentation built on March 7, 2023, 7:43 p.m.