1 Getting Started
Recspecs is useful when the easiest way to check a program is to look at what it prints. Instead of writing assertions for every small value, you run the code and keep the expected transcript next to the code that produced it.
A minimal test file looks like this:
(require recspecs) (expect (displayln "hello") "hello\n")
The expect form captures anything printed to the current output port while expr runs. It compares that captured output to the expected string in the source file, and each expect expands to a RackUnit test-case. You can run the file with raco test:
raco test hello-test.rkt |