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:
-
MemoryConstraintInfinitymemory (in bytes) the test is allowed to use MetaInformation<||>extra information associated with the test SameTestSameQfunction to compare actual and expected output TestIDAutomaticunique identifier for the test TimeConstraintInfinitytime (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 (2023), IntermediateTest, Wolfram Language function, https://reference.wolfram.com/language/ref/IntermediateTest.html.
CMS
Wolfram Language. 2023. "IntermediateTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/IntermediateTest.html.
APA
Wolfram Language. (2023). IntermediateTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IntermediateTest.html