I've started sketching a portable implementation of SRFI 269. In the
process, I've discovered a few more issues with the spec:
1. For some reason, 'metadata' appears as a quoted identifer in the
definition of 'test' and its examples. The form should be:
(test (<description> <context-id>) metadata <metadata>
<body>)
(Also, why not put the metadata inside the list, after <context-id>?)
2. context data: It's hard to use a value of a completely unspecified
type. I understand you want to leave this open to expansion, but
I think the SRFI should establish a baseline. Make it another alist,
for example, and add the test/description and (if it exists) the
suite/description keys.
If you really want to leave it unspecified, you could still give some
type-generic procedures / messages for getting data out of a context.
(For example, a 'context->alist' procedure.)
3. Since tests "should not depend on side effects", I assume mutating
the context data is forbidden. But mutation of context could be a
channel for passing data from a test back to the runner. Should there
be some non-mutative way to do this?
4. "Tests that do not need the context can use _ as the identifier."
I assume this means that 'test' should specifically omit binding the
context value if the context identifer is free-identifier=? to _. Or
is this just a recommend convention?
5. A definition of "fixture value" would be helpful. (Pardon my
ignorance of testing jargon.)
6. There seems to be no way to *run* a test or suite! I searched in
vain for runner/run-test and runner/run-suite messages. The SRFI is
quite clear that runner/load-test and runner/load-suite are "loading
form[s]" that do not execute anything.
7. Minor: Replace or define the nonstandard 'assoc-ref' procedure.
--
Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz>