Finish testing module documentation.
This commit is contained in:
parent
01f683b957
commit
4b26c653d9
2 changed files with 50 additions and 1 deletions
42
README.md
42
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),
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue