[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: procedural interface
Alex Shinn wrote:
It seems like the only forms which need to be macros are
test-assert
test-equal
test-eqv
test-eq
test-error
because they need to delay/skip evalutation of the test form and setup
appropriate error handlers.
test-group and test-group-with-cleanup also need to be macros,
because they can also be skipped.
test-with-runner also needs to be a macro, but it's a convenience
form, not primitive.
What if we define and expose test-thunk:
--procedure: test-thunk [name] thunk
which does the same as test-assert but takes a thunk which it
evaluates when it is run. Then the above macros could just be
convenience wrappers around this.
I think that works and seems to make sense.
Even if we don't expose a procedural interface the SRFI should specify
that the test-name is evaluated at runtime, for use with data driven
tests (I agree the name should be a string).
I.e. the specification should clarify that the test-name
is an expression that evaluates to string, not necessarily
a string literal?
--
--Per Bothner
per@xxxxxxxxxxx http://per.bothner.com/