Learn R Programming

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

testthat (version 0.3)

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

753,902

Version

0.3

License

GPL

Maintainer

Hadley Wickham

Last Published

August 31st, 2010

Functions in testthat (0.3)

SummaryReporter

Test reporter: summary of errors.
StopReporter

Test reporter: stop on error.
auto_test_package

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

Stub object for managing a reporter of tests.
context

Describe the context of a set of tests.
MinimalReporter

Test reporter: minimal.
find_reporter

Find reporter object given name...
source_dir

Load all source files in a directory.
auto_test

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

Execute code in specified reporter.
is_true

Expectation: is the object true?
expect_that

Expect that a condition holds.
is_false

Expectation: is the object false?
expectation

Expectation class.
gives_warning

Expectation: does expression give a warning?
dir_state

Capture the state of a directory.
matches

Expectation: does string match regular expression?
compare_state

Compare two directory states.
is_identical_to

Expectation: is the object identical to another?
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?
library_if_available

Load package, if available.
test_file

Run all tests in specified file.
test_dir

Run all of the tests in a directory.
prints_text

Expectation: does printed output match a regular expression?
shows_message

Expectation: does expression show a message?
is_equivalent_to

Expectation: is the object equivalent to a value?
throws_error

Expectation: does expression throw an error?
equals

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

Colourise text for display in the terminal.
watch

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

Create a test.
error_report

Generate error report from traceback.
test_package

Run all tests in an installed package...