[plt-scheme] data setup for SchemeUnit tests

From: Christopher Armstrong (radix at twistedmatrix.com)
Date: Mon Jul 31 15:30:31 EDT 2006

On 7/29/06, Ryan Culpepper <ryan_sml at yahoo.com> wrote:
>
> --- Christopher Armstrong <radix at twistedmatrix.com> wrote:
> This kind of problem is not the responsibility of the testing
> framework. You can use the standard abstraction mechanisms of Scheme
> (procedures and macros) to factor out common patterns in the test
> cases. Here are two ideas:


Well, I'm not really sure how it's any less the responsibility of the unit
testing framework than, say, :before and :after, or (before) (after) and
(around), as they can all be implemented in terms of test cases.

1) Factor out the creation of the output port and the extraction of
> the output as bytes into a procedure:


...



> 2) You could write a macro that produced the test case from just the
> parts that change:


I don't think either of these are the ideal abstraction level. It's a
tradeoff between wanting a terse syntax for defining the tests vs the
necessity to write lots of more-specific-than-ideal harness code that may
not be used very often; if I had a way to just specify a bindings list to
re-evaluate around every test case, that'd be a beautiful compromise.

I'm going to go for a while just functionally separating out stuff like
that, but I think eventually I'll end up writing a macro that does the
let-bindings.


-- 
Christopher Armstrong
International Man of Twistery
http://radix.twistedmatrix.com/
http://twistedmatrix.com/
http://canonical.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20060731/31df1048/attachment.html>

Posted on the users mailing list.