8.16.0.1
RackUnit Abbrevs
(require rackunit-abbrevs) | package: rackunit-abbrevs |
For writing multiple unit tests on a single function. The macros here repeatedly apply a standard RackUnit assertion on a sequence of argument (and result) pairs.
Test failures are reported at the unit test, not at the call to one of our check- macros.
1 API Functions
Apply f to each sequence of arguments arg* and assert check-true on each result.
Examples:
> (check-true* (lambda (x y #:z [z 0]) (= (+ x y z) 3)) [3 0] [1 2] [1 1 #:z 1])
> (check-true* integer? ["hello"])
--------------------
FAILURE
location: eval:3:0
name: check-true
params: '(#f)
--------------------
Apply f to each sequence of arguments arg* and assert check-false on each result.
Examples:
> (check-false* string? [1] ['lemons])
> (check-false* = [2 2])
--------------------
FAILURE
location: eval:5:0
name: check-false
params: '(#t)
--------------------
Apply f to each sequence of arguments arg* and compare to result using equal?.
When == or => or ==> is used as a delimiter, calls (check-equal? (f arg* ...) result).
Otherwise, calls (check-not-equal? (f arg* ...) result).
Example:
Examples:
> (check-exn* exn:fail:contract? vector-ref [0 #'()] ["hi"])
> (check-exn* #rx"\\+: contract violation" + [0 #\0 'O] ['() '()])
2 Library Functions
(require rackunit-abbrevs/error-reporting) | |
package: rackunit-abbrevs |
These functions are internal to the library but may be useful elsewhere.
procedure
→ (list/c any/c (or/c number? #f) (or/c number? #f) (or/c number? #f) (or/c number? #f)) stx : syntax?
Alias for build-source-location-list.
Syntax class used to rule out patterns that are definitely not procedures.
Syntax class used to rule out patterns that are definitely not predicates
or regular expressions.