Macaulay2 » Documentation
Packages » Macaulay2Doc > The Macaulay2 language > packages > check
next | previous | forward | backward | up | index | toc

check -- perform tests of a package

Synopsis

Description

It is important for package authors to provide tests to ensure that the package is functioning properly. One provides tests using the TEST function following the beginDocumentation call in the source of the package.

Optionally, one can store all tests in a tests.m2 directory under the auxiliary subdirectory of the package and load the file from the main package source file.

For example, to run the tests for the LLLBases package (Lenstra-Lenstra-Lovasz bases), use:


needsPackage "LLLBases"
check_1 LLLBases
check LLLBases

Alternatively, if the package is installed somewhere accessible, one can do the following.


check_1 "LLLBases"
check "LLLBases"

Caveat

Currently, if the package was only partially loaded because the documentation was obtainable from a database (see beginDocumentation), then the package will be reloaded, this time completely, to ensure that all tests are considered; this may affect user objects of types declared by the package, as they may be not usable by the new instance of the package. In a future version, either the tests and the documentation will both be cached, or neither will.

See also

Ways to use check :

For the programmer

The object check is a method function with options.