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/
_________________________________________________
 For list-related administrative tasks:
 http://lists.racket-lang.org/listinfo/users

Reply via email to