diff --git a/README.md b/README.md index 434d379..1684ed5 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,48 @@ exception is raised with the ```name``` of the test added to the exception. If the test passes, prints "." like all tests from this module do. + (test-equal? name expression expected-result) + +* ```name``` - identifier representing the name of the test +* ```expression``` - expression to be evaluated +* ```expected-result``` - expected result of the test expression + +Evaluates the test ```expression``` and compares the result with +```expected-result``` using ```equal?```. If the comparison fails, an +exception is raised with the ```name``` of the test added to the +exception. If the test passes, prints "." like all tests from this +module do. + + (test-true name expression) + +* ```name``` - identifier representing the name of the test +* ```expression``` - expression to be evaluated + +Evaluates the test ```expression``` and checks whether the result is +```#t``` (true). An exception is raised if it is not with the +```name``` of the test added to the exception. If the test passes, +prints "." like all tests from this module do. + + (test-false name expression) + +* ```name``` - identifier representing the name of the test +* ```expression``` - expression to be evaluated + +Evaluates the test ```expression``` and checks whether the result is +```#f``` (false). An exception is raised if it is not with the +```name``` of the test added to the exception. If the test passes, +prints "." like all tests from this module do. + + (test-exn name expression) + +* ```name``` - identifier representing the name of the test +* ```expression``` - expression to be evaluated + +Evaluates the test ```expression``` and checks whether it raised an +exception. An exception is raised if no exception was raised during +the evaluation. If the test passes, prints "." like all tests from +this module do. + ### Utils To ensure there are no external dependencies (including chicken eggs), diff --git a/testing.scm b/testing.scm index 9982f0e..ec191a3 100644 --- a/testing.scm +++ b/testing.scm @@ -27,7 +27,14 @@ (module testing - (test-eq? test-equal? test-exn test-true test-false run-tests) + ( + test-eq? + test-equal? + test-exn + test-true + test-false + run-tests + ) (import scheme (chicken condition)