Right now a test case with setup and teardown actions looks like this:
Writing a macro to correctly handle this syntax is not easy, and the
current implementation is wrong (it breaks badly on macros that expand
into test cases).
There are a couple different things we can do. First, we can keep the
existing setup and teardown concepts but change the syntax to:
(setup code ...)
(teardown code ...)
Here setup and teardown would be keywords provided from test.ss. This
macro is fairly easy to write.
Another option is to change perspective from "before/after" to "around":
let them supply a procedure that wraps execution of the test.
(around (lambda (go) (parameterize ((current-directory "there")) (go)))
This is nicer in some ways, and the macro is just as easy, but
implementing this correctly makes me worried. I'll have to think about it
The final approach is to eliminate special syntax and special notions of
test prep and strike entirely and advice the users to write their own
with-handlers and dynamic-wind expressions. We can move the concept out of
the test framework into the tests, and then we can write regular
abstractions (procedures and macros) over the common cases.
I favor the last approach, I think.