mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
* tests/optargs.test: Wrap tests in module (test-suite
test-<file-name without .test>). Rewrite test to be R5RS conforming. * tests/syntax.test: Added test to check correct handling of internal defines.
This commit is contained in:
parent
430b840193
commit
560434b369
3 changed files with 28 additions and 6 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2003-11-09 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
* tests/optargs.test: Wrap tests in module (test-suite
|
||||||
|
test-<file-name without .test>). Rewrite test to be R5RS
|
||||||
|
conforming.
|
||||||
|
|
||||||
|
* tests/syntax.test: Added test to check correct handling of
|
||||||
|
internal defines.
|
||||||
|
|
||||||
2003-11-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
2003-11-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
* tests/syntax.test (exception:missing-body-expr): New.
|
* tests/syntax.test (exception:missing-body-expr): New.
|
||||||
|
|
|
@ -18,12 +18,15 @@
|
||||||
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
;;;; Boston, MA 02111-1307 USA
|
;;;; Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
(use-modules (test-suite lib)
|
(define-module (test-suite test-optargs)
|
||||||
(ice-9 optargs))
|
:use-module (test-suite lib)
|
||||||
|
:use-module (ice-9 optargs))
|
||||||
|
|
||||||
(with-test-prefix "optional argument processing"
|
(with-test-prefix "optional argument processing"
|
||||||
(define* (test-1 #:optional (x 0))
|
|
||||||
(define d 1) ; local define
|
|
||||||
#t)
|
|
||||||
(pass-if "local defines work with optional arguments"
|
(pass-if "local defines work with optional arguments"
|
||||||
(false-if-exception (test-1))))
|
(eval '(begin
|
||||||
|
(define* (test-1 #:optional (x 0))
|
||||||
|
(define d 1) ; local define
|
||||||
|
#t)
|
||||||
|
(false-if-exception (test-1)))
|
||||||
|
(interaction-environment))))
|
||||||
|
|
|
@ -643,6 +643,16 @@
|
||||||
(eq? 'c (a 2) (a 5))))
|
(eq? 'c (a 2) (a 5))))
|
||||||
(interaction-environment))))
|
(interaction-environment))))
|
||||||
|
|
||||||
|
(expect-fail "internal defines with macro application"
|
||||||
|
(false-if-exception
|
||||||
|
(eval '(begin
|
||||||
|
(defmacro a forms
|
||||||
|
(cons 'define forms))
|
||||||
|
(let ((c identity) (x #t))
|
||||||
|
(define (a x y) (and x y))
|
||||||
|
(a (c x) (c x))))
|
||||||
|
(interaction-environment))))
|
||||||
|
|
||||||
(pass-if-exception "missing body expression"
|
(pass-if-exception "missing body expression"
|
||||||
exception:missing-body-expr
|
exception:missing-body-expr
|
||||||
(eval '(let () (define x #t))
|
(eval '(let () (define x #t))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue