Re: test-error, portability
Per Bothner 21 Aug 2020 13:21 UTC
On 8/20/20 11:49 PM, Marc Nieper-Wißkirchen wrote:
> Lassi Kortela <xxxxxx@lassi.io <mailto:xxxxxx@lassi.io>> schrieb am Do., 20. Aug. 2020, 22:41:
> IMHO it would be best for portable tests if an error type filter can be
> given, and one possibility is to give a predicate procedure. For example:
>
> (test-error file-error? (open-file "/nonexistent"))
>
> And with a test name:
>
> (test-error "Check file not found" file-error? (open-file "/nonexistent"))
>
>
> Hopefully, Per will add a post-finalization-note specifying this implementation-dependent thing, namely that in R6RS and R7RS schemes, a predicate is allowed instead of #t.
That seems reasonable. I don't see any reason to restrict it to R6RS and R7RS schemes.
Perhaps something like:
*Post-finalization recommendation:* Implementations are encouraged to allow a predicate procedure.
For example:
(test-error "Check file not found" file-error? (open-file "/nonexistent"))
We may want to fix the implementations first.
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/