test-apply and on-test-begin callback Tomas Volf (24 Jul 2024 21:32 UTC)
Re: test-apply and on-test-begin callback Per Bothner (24 Jul 2024 22:10 UTC)
Re: test-apply and on-test-begin callback Tomas Volf (25 Jul 2024 13:31 UTC)

test-apply and on-test-begin callback Tomas Volf 24 Jul 2024 21:32 UTC

Greetings,

I am in the process of implementing my own SRFI-64 library and currently am not
sure how to handle test-apply invocation with specifiers.  The specifications
seems to be bit light on details here.  What seems to be given is that
implementation has to check both the list of specifiers passed to the test-apply
and currently active skip specifiers but not much else.

I am unsure about few things:

1. In what order should the check be done?  Since the specification contains
stateful specifiers, the order of checks is relevant.  Based on the ordering in
the sentence, I assume test-apply's specifiers first, active skip specifiers
second.  Is that correct?

2. What exactly does "A test is executed if it matches any of the specifiers in
the test-apply and does not match any active test-skip specifiers." mean for the
callbacks?  For tests that match neither, should callback be called?  For tests
that match just test-apply's specifiers, it obviously should.  For tests that
match both, should they?

My current understanding of the specification is that the callbacks should be
called always for all tests (any other reading does not make sense to me due to
the *and* in the sentence).  And 'result-kind during on-test-begin should be #f,
except for the case when both match (in that case it should be 'skip).

Implication is that test runner cannot tell in on-test-begin whether the test
will be run, but can in on-test-end (since 'result-kind will remain #f due to
the test not being executed).

Is that correct understanding of the specification?  If not, could you please
point me to text that I missed/misunderstood?

Thank you and have a nice day,
Tomas Volf

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