mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
tests: records: Add test for ellipsis in body.
* tests/records.scm ("match-record, ellipsis in body"): New test.
This commit is contained in:
@@ -590,6 +590,19 @@ Description: 1st line,
|
||||
(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
|
||||
|
||||
Reference in New Issue
Block a user