writeExpectTest {BurStMisc}R Documentation

Text for a testthat test

Description

Automatically writes the text of a testthat::expect_equal test of an expression.

Usage

writeExpectTest(expr, filename = "", ...)

Arguments

expr

an expression to be tested.

filename

where should the results go to? The empty string means that it goes to the console.

...

additional arguments to cat may be given to control the output. The most likely choice is append.

Value

NULL

Side effects

text is written to the console or to a file.

Note

Some functions are hard to test, like scriptSearch. It seems like this one would be too, but in fact it is self-testing. If the test it writes doesn't pass in the same environment, then it must have done something wrong.

See Also

expect_equal.

Examples

writeExpectTest(head(1:10))
writeExpectTest(head(cars))

[Package BurStMisc version 1.1 Index]