tests: records: Add test for ellipsis in body.

* tests/records.scm ("match-record, ellipsis in body"): New test.
This commit is contained in:
Josselin Poiret 2023-06-04 10:31:08 +02:00
parent f045c7ac80
commit 178ffed3b7
No known key found for this signature in database
GPG key ID: 505E40B916171A8A

View file

@ -590,6 +590,19 @@ (define-record-type* <with-thunked> with-thunked make-with-thunked
(match-record rec <with-thunked> (normal thunked)
(list normal thunked)))))
(test-equal "match-record, ellipsis in body"
#t
(begin
(define-record-type* <foo> foo make-foo foo?
(value foo-value))
(define bar (foo (value '(1 2 3))))
(match-record bar <foo> (value)
(match value
((one two ...)
#t)
(_
#f)))))
(test-equal "match-record-lambda"
'("thing: foo" "thing: bar")
(begin