[racket] Price of RackUnit

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Wed Jul 6 21:01:09 EDT 2011

For the example module you gave, I believe that any time that module is 
loaded by "require" or similar, those tests will be evaluated.

There is a recent discussion thread that's relevant to wanting to embed 
tests in modules this way:
http://lists.racket-lang.org/dev/archive/2011-June/006815.html

For now, I think that the preferred place for tests is in separate 
modules that "require" the module to be tested.  I think that is the 
friendliest thing for PLaneT modules, at least, since we like reusable 
modules to load quickly, and unit testing at each load time is overkill 
for almost every application.

That said, I *have* embedded startup-time tests in production 
Racket-based systems.  The one that comes to mind, the test is quick, 
and it verifies an assumption of the module about a behavior of Racket 
that, IIRC, is not guaranteed and might be specific to some host OS or 
hardware architectures.  Unit tests, however, are in separate modules.

-- 
http://www.neilvandyke.org/


Posted on the users mailing list.