chibi-scheme/tests
Daphne Preston-Kendal 92fa73ecab Better case-lambda tests
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.)
2022-04-18 10:05:40 +02:00
..
basic Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
build disable fileno unification by default 2021-04-27 18:30:43 +09:00
ffi Initialize variables in FFI tests 2021-06-06 11:19:52 +09:00
foreign remove unused variable 2021-07-23 22:19:27 +01:00
install Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
memory updating trace in oom tests 2018-01-25 00:11:44 +09:00
run -R needs interpreter name, not SRFI 22 2019-01-01 23:18:49 +08:00
snow Fixing snow doc extraction for multiple levels of includes. 2017-01-19 23:58:09 +09:00
division-tests.scm Add regression tests for remainder with infinity. 2018-03-15 21:48:19 -05:00
lib-tests.scm add docs and tests for assert, unify with SRFI 145 2021-05-06 20:34:03 +09:00
r5rs-tests.scm Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
r7rs-tests.scm Better case-lambda tests 2022-04-18 10:05:40 +02:00
re-tests.txt Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
syntax-tests.scm Move identifier-syntax to (chibi ast) 2022-03-15 10:27:56 +01:00
unicode-tests.scm Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00