Learn R Programming

⚠️There's a newer version (3.2.3) of this package.Take me there.

testthat (version 0.7.1)

Testthat code. Tools to make testing fun :)

Description

A testing package specifically tailored for R that's fun, flexible and easy to set up.

Copy Link

Version

Install

install.packages('testthat')

Monthly Downloads

578,511

Version

0.7.1

License

GPL

Maintainer

Hadley Wickham

Last Published

March 27th, 2013

Functions in testthat (0.7.1)

Reporter

Stub object for managing a reporter of tests.
TapReporter

Test reporter: TAP format.
SummaryReporter

Test reporter: summary of errors.
expect_that

Expect that a condition holds.
gives_warning

Expectation: does expression give a warning?
colourise

Colourise text for display in the terminal.
context

Describe the context of a set of tests.
compare_state

Compare two directory states.
fail

A default expectation that always fails.
MinimalReporter

Test reporter: minimal.
dir_state

Capture the state of a directory.
is_equivalent_to

Expectation: is the object equivalent to a value? This expectation tests for equivalency: are two objects equal once their attributes have been removed.
prints_text

Expectation: does printed output match a regular expression?
error_report

Generate error report from traceback.
test_package

Run all tests in an installed package
is_false

Expectation: is the object false?
make_expectation

Make an equality test.
is_true

Expectation: is the object true?
StopReporter

Test reporter: stop on error.
matches

Expectation: does string match regular expression?
find_reporter

Find reporter object given name
library_if_available

Load package, if available.
watch

Watch a directory for changes (additions, deletions & modifications).
test_dir

Run all of the tests in a directory.
auto_test

Watches code and tests for changes, rerunning tests as appropriate.
auto_test_package

Watches a package for changes, rerunning tests as appropriate.
is_identical_to

Expectation: is the object identical to another?
shows_message

Expectation: does expression show a message?
test_file

Run all tests in specified file.
with_reporter

Execute code in specified reporter.
equals

Expectation: is the object equal (with numerical tolerance) to a value?
test_that

Create a test.
throws_error

Expectation: does expression throw an error?
source_dir

Load all source files in a directory.
expectation

Expectation class.
is_a

Expectation: does the object inherit from a class?
takes_less_than

Expectation: does expression take less than a fixed amount of time to run?