Hello,

Suppose I have this simple R6RS script:

----------------------------------------------------------------------
(import (rnrs)
        (srfi :64))

(test-begin "math-examples")

(test-assert (number? 5))

(test-assert (number? 'x))

(test-end "math-examples")
----------------------------------------------------------------------

Running it:

----------------------------------------------------------------------
%%%% Starting test math-examples
FAIL
# of expected passes      1
# of unexpected failures  1
----------------------------------------------------------------------

It would be nice if it showed the actual failing test. I see that you can pass a "test name" to procedures like 'test-assert'. So for example:

----------------------------------------------------------------------
(import (rnrs)
        (srfi :64))

(test-begin "math-examples")

(test-assert (number? 5))

(test-assert '(number? 'x) (number? 'x))

(test-end "math-examples")
----------------------------------------------------------------------

will give output:

----------------------------------------------------------------------
%%%% Starting test math-examples
FAIL (number? 'x)
# of expected passes      1
# of unexpected failures  1
----------------------------------------------------------------------

So, that's a little better.

Of course, it's a hassle to pass the expression to 'test-assert' twice. Sure, I could cook up some syntax. Does anybody know of a simpler way?

Ed

Reply via email to