IntermediateTest
IntermediateTest[input]
creates an intermediate test to determine whether input evaluates to True.
IntermediateTest[input,expected]
creates an intermediate test to determine whether input evaluates to expected.
IntermediateTest[input,expected,messages]
creates an intermediate test that is expected to generate the list of message names messages.
Details and Options
- IntermediateTest returns the evaluated input.
- IntermediateTest is typically used inside VerificationTest or TestCreate in order to break up a complex test into multiple tests.
- If an IntermediateTest fails, any enclosing test will fail.
- IntermediateTest has attribute HoldAllComplete.
- IntermediateTest has the following options:
-
MemoryConstraint Infinity memory (in bytes) the test is allowed to use MetaInformation < > extra information associated with the test SameTest SameQ function to compare actual and expected output TestID Automatic unique identifier for the test TimeConstraint Infinity time (in seconds) the test is allowed to use - TestIDAutomatic creates a unique ID by doing a hash of the test expression.
- IntermediateTest evaluates tests without displaying messages.
Examples
open allclose allBasic Examples (2)
Create a test that tests whether the input evaluates to True:
If an IntermediateTest fails, the outer test fails:
Scope (1)
Run a test that uses at least one IntermediateTest:
The "IntermediateTests" property extracts all the intermediate tests as TestObject expressions:
All TestObject properties are available for intermediate tests:
Applications (2)
IntermediateTest can be used to test the setup phase of another test:
Text
Wolfram Research (2024), IntermediateTest, Wolfram Language function, https://reference.wolfram.com/language/ref/IntermediateTest.html.
CMS
Wolfram Language. 2024. "IntermediateTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/IntermediateTest.html.
APA
Wolfram Language. (2024). IntermediateTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IntermediateTest.html