mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
The problem with the original `case-lambda` tests is that they could actually pass if the `+` and `*` procedures were implemented correctly but `case-lambda` itself wasn’t. Specifically, an attempted optimized `case-lambda` implementation which looked at the length of its arguments list and subsequently erroneously always chose the variadic clause of the `plus` procedure would still pass the test, because `plus` in this case recreated the behaviour of the `+` procedure used for the test; it was never actually observable whether the `args` clause or one of the more specific clauses had been used to generate the result. Similar applies to the `mult` test: although in that case an implementation could only have erroneously chosen the `(x y . z)` clause in the two-argument case, it would still have been an error invisible to the test cases. I’ve also added a test which attempts to ensure that a redundant clause will never match. This may cause a warning on Schemes which detect such clauses at compile time, but R7RS does not explicitly define such `case-lambda` expressions as erroneous in any way, so it would be wrong (and non-conformant) for it to stop the tests running altogether. (This patch mainly useful because Chibi’s R7RS tests are sometimes used by other implementations to ensure conformance. Chibi passed these tests in any case.) |
||
---|---|---|
.. | ||
basic | ||
build | ||
ffi | ||
foreign | ||
install | ||
memory | ||
run | ||
snow | ||
division-tests.scm | ||
lib-tests.scm | ||
r5rs-tests.scm | ||
r7rs-tests.scm | ||
re-tests.txt | ||
syntax-tests.scm | ||
unicode-tests.scm |