Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

test_examples

Test package examples


Description

These helper functions make it easier to test the examples in a package. Each example counts as one test, and it succeeds if the code runs without an error. Generally, this is redundant with R CMD check, and is not recommended in routine practice.

Usage

test_examples(path = "../..")

test_rd(rd, title = attr(rd, "Rdfile"))

test_example(path, title = path)

Arguments

path

For test_examples(), path to directory containing Rd files. For test_example(), path to a single Rd file. Remember the working directory for tests is tests/testthat.

rd

A parsed Rd object, obtained from tools::Rd_db() or otherwise.

title

Test title to use


testthat

Unit Testing for R

v3.0.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph, fnd], R Core team [ctb] (Implementation of utils::recover())
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.