[racket] Price of RackUnit

From: John Clements (clements at brinckerhoff.org)
Date: Wed Jul 6 20:59:22 EDT 2011

On Jul 6, 2011, at 4:40 PM, Patrick King wrote:

> I find myself doing stuff like...
> #lang racket
> (require rackunit)
> (provide my-function ...)
> ; My code
> (define (my-function ...) ...) ...
> ; My tests ...
> (check* ...) ... ; * in the wildcard sense
> ... so that I never evade testing my code. Does another developer end up testing my code? A user?
> In other words, if I don't export the test code via require, what gets executed by importers? of source? of executables?
> IMHO, even if the answer is "all of it", it's worth it, but the answer may affect how tests are written.

Calling the 'check-*' functions perform a check.  This means that these tests are run whenever the 
given module is 'require'd [*]. However, rackunit provides a fairly smooth "upgrade" path, in the sense
that you can take a bunch of checks and wrap them in a "test suite" form that means that they'll only 
be run when requested.

John Clements

[*] There's no distinction between "requiring source" and "requiring executables"; using 'require' allows
 a module to use the things 'provide'd from that module.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4624 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20110706/5ce459a2/attachment.p7s>

Posted on the users mailing list.