VerificationTest
VerificationTest[input]
runs a verification test to determine whether input evaluates to True, without issuing messages.
VerificationTest[input,expected]
tests whether input evaluates to expected, without issuing messages.
VerificationTest[input,expected,messages]
tests whether input evaluates to expected, generating the list of message names messages.
Details and Options

- VerificationTest returns a TestResultObject.
- VerificationTest has attribute HoldAllComplete.
- VerificationTest has the following options:
-
MemoryConstraint Infinity memory (in bytes) the test is allowed to use SameTest SameQ function to compare actual and expected output TestID None unique identifier for the test TimeConstraint Infinity time (in seconds) the test is allowed to use - TestIDAutomatic creates a unique UUID each time the test is run.
Examples
open allclose allBasic Examples (3)
Test whether the input evaluates to True:
Test whether the input evaluates to the expected output:
Scope (2)
Basic Uses (2)
Perform a test and present the results in a Dataset:
Test if the results of an NIntegrate are numerically equivalent to Integrate, by using an absolute tolerance:
This can also be done by using the SameTest option:
Options (7)
SameTest (4)
TestID (1)
Add TestID to a VerificationTest:
Possible Issues (5)
The expected output is evaluated before comparison with the actual output:
Messages generated on evaluation of expected output are not accounted for in the expected messages:
If both actual and expected output encounter a time constraint or memory constraint, the test is reported to have succeeded:
This is because both the actual and expected output evaluated to a Failure:
If SameTest does not evaluate to True or False, an outcome of "Error" is reported:
Tests for functions that produce Graphics or special typesetting may produce unexpected results:

This is because the input expressions and the output are not SameQ:

Text
Wolfram Research (2014), VerificationTest, Wolfram Language function, https://reference.wolfram.com/language/ref/VerificationTest.html.
BibTeX
BibLaTeX
CMS
Wolfram Language. 2014. "VerificationTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VerificationTest.html.
APA
Wolfram Language. (2014). VerificationTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VerificationTest.html