| verify {verify} | R Documentation |
verify is a generic function that
creates or uses an object of class "verify" to check returned values
of R functions.
verify(x, ...) verify.default(x, data = list(), ...) verify.verify(x, ...)
x |
either a vector of character strings that are commands to
be tested, or an object of class "verify". If a character vector is given, it is often useful if it has names that summarize the commands. |
data |
a named list of data to use in the commands. |
... |
generic arguments. |
The commands may include the output from previous commands in the object. The result of any previous command is available as `Test.' plus the name of the test. The index number is used if there are no names.
verify is valuable to insure that changes in the code, the R version,
the operating system or the hardware do not change (substantially) the
results of the tested commands.
There is a print method for the "verify" class of objects.
There is also a method for [.
an object of class "verify" that is a list of the results of the
commands.
In addition to class and possibly names, it has the
following attributes:
data |
the input or default value of data. |
passed |
a logical vector, or a list that is the result
of all.equal on the new versus original results
for each command. |
random.seed |
the random seed needed to reproduce results that depend on the random number generator. |
specifics |
a list providing the details of how and when the object was created. |
If any of the commands require random numbers, then
.Random.seed is created or changed in the current directory.
Nick Efthymiou
S Poetry, Patrick J. Burns, Section 3.6, p. 52–58, www.seanet.com/~pburns/Spoetry
## Not run:
jjverif <- dget(file.path("tests", "jjverif"))
print(verify(jjverif),short=TRUE)
jjdig <- dget(file.path("tests", "jjdig"))
jjg <- dget(file.path("tests", "jjg"))
save(list = ls(pattern="jj"),
file=file.path("tests", "jjverifgraph.rda"),
ascii=TRUE, compress=TRUE)
load(file.path("tests", "jjverifgraph.rda"))
verify(jjverifgraph)
# Exclude two tests that use empty mathgraph()
print(verify(jjverifgraph[c(-4,-13)]), short = TRUE)
## End(Not run)