[racket] Rackunit best practices

From: Laurent (laurent.orseau at gmail.com)
Date: Fri Aug 23 01:48:10 EDT 2013

On Fri, Aug 23, 2013 at 12:14 AM, Greg Hendershott <
greghendershott at gmail.com> wrote:

> In my opinion the "most Rackety" way to do tests these days is what
> Laurent mentioned: The `test` submodule.
>

When the tests become too long, I prefer to put them in a separate file
though.


> (Although when I do this, occasionally I wish for "test-folding" to
> hide the tests temporarily. Neat feature to add to DrRacket and/or
> emacs Racket mode?)
>

I've been wanting that for a long time too.
If only DrRacket had line-folding, we could fold any kind of submodule,
like documentation, test, main.


> Given that, I'm not familiar enough with Ruby "guard" to know what's
> left for a Racket "guard" to do -- just the detection for re-running
> some test automatically? As Laurent mentioned DrRacket already will do
> that automatically as you edit each file. For users of other editors,
> or for other scenarios like fetching from git, I suppose this would
> amount to keeping some cache of the last-modified or MD5 of all the
> sources, and running `raco test` ones that have changed?
>

Another automatic and easy way is to run the tests on file save, as a
plugin for DrRacket.
It should not be too difficult to extend Grant Rettke's DrSync plugin:
http://planet.plt-scheme.org/display.ss?package=drsync.plt&owner=grettke

Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130823/c9d0be29/attachment.html>

Posted on the users mailing list.