class TEST
****
To be included by a testing class. The test routine should start with the call `class_name("CLASS_FOO");'. It should then have calls to `test' or `unchecked_test' which actually perform the test. It should end with `finish' to print out the results. The results are sent to both `stderr' and `stdout' so you can redirect output to a file and still see whether all tests were passed. The routine being tested must return a string. The basic classes all have routines named `str' to produce string representations of themselves. A typical test might look something like: `test("sum", (1+1).str, "2");'. The tests are numbered and the failures are summarized at the end.


Flattened version is here

Descendants
TEST_DIGRAPH TEST_ARRAY2 TEST_FLIST TEST_FSTR
TEST_CPX TEST_ARRAY3 TEST_BOOL TEST_STR_CURSOR
TEST_FMAP TEST_BTREE TEST_MAP TEST_C
TEST_DIGRAPH_VIEWS TEST_FLTD_OUTPUT TEST_PQ TEST_SORT
TEST_AREF TEST_FGAP_LIST TEST_FORTRAN TEST_I_INTERVAL
TEST_INT TEST_CHAR TEST_REGEXP TEST_RND
TEST_FMT TEST_FSET TEST_BAG TEST_WTD_DIGRAPH
TEST_SET TEST_LIST TEST_FMULTIMAP TEST_QUEUE
TEST_MATVEC TEST_UGRAPH TEST_STACK TEST_MATH{_}
TEST_SVD TEST_ARRAY TEST_ARR_ALG TEST_TUP
TEST_MULTIMAP



Public


Readonly Shareds
shared checked_tests:INT;
shared class_name_str:STR;
**** The name of the tested class.
shared failure_docs:FLIST{STR};
**** The documentation of the failures.
shared failures:FLIST{INT};
**** The tests which failed.
shared test_number:INT;
**** Which test.

Writable Shareds
shared checked_tests:INT;
shared class_name_str:STR;
**** The name of the tested class.
shared failure_docs:FLIST{STR};
**** The documentation of the failures.
shared failures:FLIST{INT};
**** The tests which failed.
shared test_number:INT;
**** Which test.

Features
class_name(nm:STR)
**** Specify the name of the class being tested. Must be called first.
finish
**** Complete the testing on the current class.
raise_test(testname:$STR,testrout:ROUT:FMT,should:STR)
**** Performs the test with the desciption 'doc'. The routine 'testrout' is expected to raise an exception with the string representation 'should'.
test(doc_ds,does_ds,should_ds:$STR)
**** Perform the test with the description `doc', return value `does', and desired return value `should'. Keep track of failures.
unchecked_test(doc_ds,does_ds,should_ds:$STR)
**** Perform the test with the description `doc', return value `does', and desired return value `should'. Don't keep track of failures.

The Sather Home Page