Rob Browning <r...@defaultvalue.org> writes:

> And while looking at I wondered if I might have found a bug -- my
> reading of the test-runner-test-name docs suggested that this might show
> "outer group" for the final name:, but it still shows the test-assert
> name.
>
>   (define (show-name)
>     (format #t "name: ~a\n" (test-runner-test-name (test-runner-current))))
>
>   (test-group "outer group"
>     (show-name)
>     (test-assert "assert"
>       (begin
>         (show-name)
>         #t))
>     (show-name))

Honestly this is just under-specified in the SRFI-64.  The full wording
of description for test-runner-test-name is:

> Returns the name of the current test or test group, as a
> string. During execution of test-begin this is the name of the test
> group; during the execution of an actual test, this is the name of the
> test-case. If no name was specified, the name is the empty string.

Both your calls to `show-name' are done neither during "execution of
test-begin" nor during "execution of an actual test".  My reading of the
specification is that the behavior here is undefined.  But in the spirit
of the behavior of test result properties, it made sense to me to leave
the last valid value in there.

Maybe I am missing something.

Have a nice day,
Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

Reply via email to