Unit Testing for R


[Up] [Top]

Documentation for package ‘testthat’ version 1.0.2

Help Pages

testthat-package R package to make testing fun!
auto_test Watches code and tests for changes, rerunning tests as appropriate.
auto_test_package Watches a package for changes, rerunning tests as appropriate.
capture_messages Evaluate a promise, capturing all types of output.
capture_output Evaluate a promise, capturing all types of output.
capture_warnings Evaluate a promise, capturing all types of output.
CheckReporter Check reporter: 13 line summary of problems
compare Provide human-readable comparison of two objects
compare.character Provide human-readable comparison of two objects
compare.default Provide human-readable comparison of two objects
compare.numeric Provide human-readable comparison of two objects
compare.POSIXt Provide human-readable comparison of two objects
comparison-expectations Expectation: is returned value less or greater than specified value?
context Describe the context of a set of tests.
describe describe: a BDD testing language
equality-expectations Expectation: is the object equal to a value?
evaluate_promise Evaluate a promise, capturing all types of output.
expect_cpp_tests_pass Test Compiled Code in a Package
expect_equal Expectation: is the object equal to a value?
expect_equal_to_reference Expectation: is the object equal to a reference value stored in a file?
expect_equivalent Expectation: is the object equal to a value?
expect_error Expectation: does code produce output/message/warning/error?
expect_false Expectation: is the object true/false?
expect_gt Expectation: is returned value less or greater than specified value?
expect_gte Expectation: is returned value less or greater than specified value?
expect_identical Expectation: is the object equal to a value?
expect_is Expectation: does the object inherit from a S3 or S4 class, or a base type?
expect_length Expectation: does a vector have the specified length?
expect_less_than Expectation: is returned value less or greater than specified value?
expect_lt Expectation: is returned value less or greater than specified value?
expect_lte Expectation: is returned value less or greater than specified value?
expect_match Expectation: does string/output/message/warning/error match a regular expression?
expect_message Expectation: does code produce output/message/warning/error?
expect_more_than Expectation: is returned value less or greater than specified value?
expect_named Expectation: does object have names?
expect_null Expectation: does the object inherit from a S3 or S4 class, or a base type?
expect_output Expectation: does code produce output/message/warning/error?
expect_output_file Expectation: does code produce output/message/warning/error?
expect_s3_class Expectation: does the object inherit from a S3 or S4 class, or a base type?
expect_s4_class Expectation: does the object inherit from a S3 or S4 class, or a base type?
expect_silent Expectation: does code produce output/message/warning/error?
expect_true Expectation: is the object true/false?
expect_type Expectation: does the object inherit from a S3 or S4 class, or a base type?
expect_warning Expectation: does code produce output/message/warning/error?
fail Default expectations that alway succeed or fail.
FailReporter Test reporter: fail at end.
inheritance-expectations Expectation: does the object inherit from a S3 or S4 class, or a base type?
ListReporter List reporter: gather all test results along with elapsed time and file information.
logical-expectations Expectation: is the object true/false?
make_expectation Make an equality test.
MinimalReporter Test reporter: minimal.
MultiReporter Multi reporter: combine several reporters in one.
output-expectations Expectation: does code produce output/message/warning/error?
RstudioReporter Test reporter: RStudio
SilentReporter Test reporter: gather all errors silently.
skip Skip a test.
skip_if_not Skip a test.
skip_if_not_installed Skip a test.
skip_on_appveyor Skip a test.
skip_on_bioc Skip a test.
skip_on_cran Skip a test.
skip_on_os Skip a test.
skip_on_travis Skip a test.
source_dir Source a file, directory, or all helpers.
source_file Source a file, directory, or all helpers.
source_test_helpers Source a file, directory, or all helpers.
StopReporter Test reporter: stop on error.
succeed Default expectations that alway succeed or fail.
SummaryReporter Test reporter: summary of errors.
TapReporter Test reporter: TAP format.
TeamcityReporter Test reporter: Teamcity format.
testthat R package to make testing fun!
testthat_results Create a 'testthat_results' object from the test results as stored in the ListReporter results field.
test_check Run all tests in an installed package.
test_dir Run all of the tests in a directory.
test_example Test package examples
test_examples Test package examples
test_file Run all tests in specified file.
test_package Run all tests in an installed package.
test_path Locate file in testing directory.
test_that Create a test.
try_again Try evaluating an expressing multiple times until it succeeds.
use_catch Use Catch for C++ Unit Testing
watch Watch a directory for changes (additions, deletions & modifications).
with_mock Mock functions in a package.