writeExpectTest {BurStMisc} | R Documentation |
Automatically writes the text of a testthat::expect_equal
test of an expression.
writeExpectTest(expr, filename = "", ...)
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 |
NULL
text is written to the console or to a file.
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.
writeExpectTest(head(1:10))
writeExpectTest(head(cars))