The Test Comparator


The test comparator is a useful feature for seeing exactly what the error is in a test failure.

First, you should run a test file or test suite. Then select one of the test failures: this should show the expected and actual results in the test report. A sample is shown in the following.

MUnit Tester

In case it is hard to actually see the problem, you can use the test comparator. Select the test, right-click, and choose Failure Compare, as shown below.

MUnit Tester

(Note that you can also open the expression comparator from the test report toolbar by clicking on the test compare icon MUnit Tester.)

This opens the comparator, which is a tree view showing the expected and actual trees. The trees are tied together so that opening equivalent levels in one opens the other. They are also marked to show where the errors are. An example is shown below.

MUnit Tester

This shows that at the first level the expected expression has fun as a head but the actual expression has Power as a head.