9 Motivation of choices
Easy to understand and flexible
There are two approaches for testing. In one extreme the tests are written using declarations dealing with setup, cleanup, running and testing the result. In the other extreme a test is simply a Prolog goal that is supposed to succeed. We have chosen to allow for any mixture of these approaches. Written down as test/1 we opt for the simple succeeding goal approach. Using options to the test the user can choose for a more declarative specification. The user can mix both approaches.
The body of the test appears at the position of a clause-body. This simplifies identification of the test body and ensures proper layout and colouring support from the editor without the need for explicit support of the unit test module. Only clauses of test/1 and test/2 may be marked as non-called in environments that perform cross-referencing.
Index
- ?
- assertion/1
- 2.2.5 2.2.5
- begin_tests/1
- 2 6
- begin_tests/2
- call_cleanup/2
- 2
- catch/3
- 2.2.4
- copy_term/2
- 2
- end_tests/1
- 2 6
- findall/3
- 2.2.3
- load_test_files/1
- 3
- make/0
- 6
- make_tests/3
- 7
- member/2
- 2.2.1
- run_tests/0
- 4.1 6
- run_tests/1
- 6 6
- running_tests/0
- set_test_options/1
- setof/3
- 2.2.3
- sort/2
- 2
- subsumes_term/2
- 2
- term_expansion/2
- 8
- test/1
- 9 9
- test/2
- 2.1 9
- test_report/1
- throw/1
- 2
- variant/2
- 2