Writing Tests for the Test Framework

Tests are defined by creating a module of class Test within the module to be tested.

A module may contain zero or more tests

Each test must either return Invalid if it is a subroutine, or slay itself upon completion

A test must call one or more Assert functions

Tests are passed two parameters:

Owner: Module value of the module to test (static parent of the test module)

Framework: Object value of the Test Framework code where the Assert functions are defined.

A test is responsible for creating the environment for the module under test (MUT). This can be done by defining globally-referenced variables and modules in the MUT within the Test module itself, and/or with the use of Fixtures.

Variables outside the scope of the MUT must exist in the Test module or in a fixture.

A test is run in its own thread

The MUT is reloaded for each test to make sure all temporary variables are cleared before each test

Tests run with no parent scope aside from any fixtures declared

Tests may not contain other tests

Topics in this section:

Assert Subroutines

Fixture Modules

Using the ThreadIdle Function

SetOverride