diff options
author | Mark H Weaver <mhw@netris.org> | 2018-11-11 23:07:47 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2018-11-11 23:14:18 -0500 |
commit | 8e86dd93a0640161fe0098a80ccc9b814dddd280 (patch) | |
tree | 9e7b43b3d1cd578cc65c452238f8f7b2b71d5fb5 /test-suite | |
parent | f24bdb78a3ab99bebfa56c2c9e0c8ee4a70460b6 (diff) |
Update (ice-9 match) to include selected bug fixes from upstream.
Fixes <https://bugs.gnu.org/22925> and other bugs.
* module/ice-9/match.upstream.scm: Apply selected fixes from the
upstream match.scm in Chibi-Scheme.
* test-suite/tests/match.test.upstream: Add more tests from upstream.
Diffstat (limited to 'test-suite')
-rw-r--r-- | test-suite/tests/match.test.upstream | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test-suite/tests/match.test.upstream b/test-suite/tests/match.test.upstream index e1e106e3b..7cbb80433 100644 --- a/test-suite/tests/match.test.upstream +++ b/test-suite/tests/match.test.upstream @@ -28,6 +28,7 @@ (test "duplicate symbols fail" 'ok (match '(ok . bad) ((x . x) 'bad) (else 'ok))) (test "duplicate symbols samth" 'ok (match '(ok . ok) ((x . 'bad) x) (('ok . x) x))) (test "duplicate symbols bound" 3 (let ((a '(1 2))) (match a ((and (a 2) (1 b)) (+ a b)) (_ #f)))) +(test "duplicate quasiquote" 'ok (match '(a b) ((or `(a ,x) `(,x b)) 'ok) (_ #f))) (test "ellipses" '((a b c) (1 2 3)) (match '((a . 1) (b . 2) (c . 3)) @@ -166,4 +167,12 @@ (((and x (? symbol?)) ..1) x) (else #f))) +(test "match-named-let" 6 + (match-let loop (((x . rest) '(1 2 3)) + (sum 0)) + (let ((sum (+ x sum))) + (if (null? rest) + sum + (loop rest sum))))) + (test-end) |