Previous Up Next

3.2  Manipulation Pragmas

Not all qtest pragmas directly translate into tests; for non-trivial projects, sometimes a little boilerplate code is needed in order to set the tests up properly. The pragmas which do this are collectively called "manipulation pragmas"; they are described in the next section.

3.2.1  Opening Modules: open Pragma <...> and --preamble Option

The tests should have access to the same values as the code under test; however the generated code for foo.ml does not actually live inside that file. Therefore some effort must occasionally be made to synchronise the code’s environment with the tests’. There are three main usecases where you might want to open modules for tests:

3.2.2  Code Injection Pragma: {...}

TODO: ocamldoc comments that define unit tests from the offered examples


Previous Up Next