TestFailures - Maple Help

CodeTools

 TestFailures
 find which, if any, tests have failed

 Calling Sequence TestFailures()

Description

 • The TestFailures command will return a list of the labels for all of the calls to Test that have failed in the current session (that is, since the last restart command).

Examples

 > $\mathrm{with}\left(\mathrm{CodeTools}\right):$

Consider the following test suite. We would expect the second and third test case to fail.

 > $\mathrm{Test}\left(\mathrm{sin}\left(\mathrm{\pi }\right),0,\mathrm{label}="sine of pi"\right)$
 sine of pi passed
 > $\mathrm{Test}\left(\mathrm{cos}\left(\mathrm{\pi }\right),\frac{1}{2},\mathrm{label}="cosine of pi"\right)$
 cosine of pi failed  Expected result : 1/2  Evaluated result: -1
 > $\mathrm{Test}\left(\mathrm{tan}\left(\mathrm{\pi }\right),1\right)$
 Test 1 failed  Expected result : 1  Evaluated result: 0

We now obtain the list of failures. Note the label for the third test case has been generated.

 > $\mathrm{TestFailures}\left(\right)$
 $\left[{"cosine of pi"}{,}{"Test 1"}\right]$ (1)

Compatibility

 • The CodeTools[TestFailures] command was introduced in Maple 2021.