Defines a set of functions to write test scripts.
N.B. (mosh test) used to use (srfi :64 testing) as backend, but it is rewritten for performance reason.
(import (rnrs)
(mosh test)
(test-false (number? 'a))
(test-results))| Unit Testing | Defines a set of functions to write test scripts. |
| (mosh test) | Unit Testing library |
| Functions | |
| fail | Always fail. |
| test-true | Run the test and check the result is not #f. |
| test-false | Run the test and check the result is #f. |
| test-eq | This is equivalent to |
| test-eqv | This is equivalent to |
| test-equal | This is equivalent to |
| test-write-equal | Check (write expr) is equal to expected. |
| test-error | Evaluating test-expr is expected to signal an error.The kind of error is indicated by error-type. |
| test-null | Run the test and check the result is null. |
| test-results | Show the test results. |
| good-enough? | for floating point number comparison. |
Unit Testing library
| Functions | |
| fail | Always fail. |
| test-true | Run the test and check the result is not #f. |
| test-false | Run the test and check the result is #f. |
| test-eq | This is equivalent to |
| test-eqv | This is equivalent to |
| test-equal | This is equivalent to |
| test-write-equal | Check (write expr) is equal to expected. |
| test-error | Evaluating test-expr is expected to signal an error.The kind of error is indicated by error-type. |
| test-null | Run the test and check the result is null. |
| test-results | Show the test results. |
| good-enough? | for floating point number comparison. |
Evaluating test-expr is expected to signal an error.The kind of error is indicated by error-type.
If the error-type is left out, or it is #t, it means “some kind of unspecified error should be signaled”.
(test-error error-type test-expr)
| test-name | test name. |
| error-type | error-type pred |
| test-expr | test-expr to evaluate. |
unspecified.