[racket-dev] [racket] Disable/Enable Tests

From: Stephen Bloch (bloch at adelphi.edu)
Date: Mon Nov 28 10:41:24 EST 2011

On Nov 28, 2011, at 8:39 AM, Kathy Gray wrote:

> I don't recall our original reasoning, but I envision that with such a macro students will think they are only disabling the tests "below" the "call" and become confused.

I can see why they might expect that.  I can also see why they (or I) might WANT that.

Suppose I've got a long homework assignment with thirty different functions and several
test cases for each, and I'm in the middle of debugging function #25.  What workflow would you recommend?  True, it's not much hassle to keep running old working test cases (unless they take a long time, which is rare), but what if I want to use the Stepper to debug function #25?

One answer is to comment out all the already-working functions, and use the Stepper on the one I care about... except that it uses a helper function that I just commented out.  So I need to uncomment that one, and the global "variables" (i.e. constants) that it refers to.

It would be a whole lot nicer to insert
(disable-tests)
and
(enable-tests)
in the code, or perhaps to wrap a bunch of lines of code in
(with-tests-disabled ...)
or
(with-tests-enabled ...)


Stephen Bloch
sbloch at adelphi.edu




Posted on the dev mailing list.