From c16ddd31b95bfbae290c01aac06c4992b01829fb Mon Sep 17 00:00:00 2001 From: "W. Kosior" Date: Mon, 15 Jul 2024 17:34:07 +0200 Subject: Test syntactic sugar for initializing fields with list-values. --- tests/guile/de-paul-records-test.scm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'tests/guile') diff --git a/tests/guile/de-paul-records-test.scm b/tests/guile/de-paul-records-test.scm index 7bcc60d..fff1606 100644 --- a/tests/guile/de-paul-records-test.scm +++ b/tests/guile/de-paul-records-test.scm @@ -26,6 +26,7 @@ is-scheme? #:export? yes,ofcourse (is-syntactically-scoped? #:default #f) + (authors #:default '()) #:finalize (lambda (the-lisp) (set-field the-lisp (lisp-is-syntactically-scoped?) @@ -49,7 +50,7 @@ '*lisp)) (test-group "lisp paren-3001" - (tu:test-equal '(#f "paren-3001" #f) + (tu:test-equal '(#f () "paren-3001" #f) (eval '(begin (define %paren-3001 (lisp (is-scheme? #f) @@ -57,10 +58,12 @@ (match %paren-3001 (($* lisp + authors is-syntactically-scoped? name is-scheme?) (list is-syntactically-scoped? + authors name is-scheme?)))) (test-env 'lisp))) @@ -83,6 +86,7 @@ (name #:-> ((const 'test-noop)) (string-append name ".1")) + (authors #:list "Jane Doe") (is-syntactically-scoped? #t))) (match `(a . ,%paren-3001.1) @@ -95,7 +99,11 @@ '(match (vector %paren-3001.1) (#(($* lisp is-scheme? name)) (list is-scheme? name))) - (test-env 'lisp)))) + (test-env 'lisp))) + + (tu:test-equal '("Jane Doe") + (eval '(lisp-authors %paren-3001.1) + (test-env 'lisp)))) (test-group "lisp paren-3003" (tu:test-equal '(#t #t) @@ -105,6 +113,7 @@ (let ((name "paren-3003")) (lisp #:<- (lisp) name + (authors #:list "Jane Doe" "John Smith") (is-scheme? (string-suffix? "-3003" name))))) (match %paren-3003 @@ -114,6 +123,10 @@ (tu:test-equal "paren-3003" (eval '(lisp-name %paren-3003) + (test-env 'lisp))) + + (tu:test-equal '("Jane Doe" "John Smith") + (eval '(lisp-authors %paren-3003) (test-env 'lisp)))) (test-group "lisp paren-3004" -- cgit v1.2.3