1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 22:31:12 +02:00

* tests/syntax.test ("let,duplicate bindings", "let*,duplicate

bindings", "letrec,duplicate bindings"): Expect to pass, bug has
been fixed.
This commit is contained in:
Marius Vollmer 2001-03-03 23:54:42 +00:00
parent 185ab0ef10
commit c0ed1605f1

View file

@ -20,6 +20,8 @@
(define exception:bad-bindings (define exception:bad-bindings
(cons 'misc-error "^bad bindings")) (cons 'misc-error "^bad bindings"))
(define exception:duplicate-bindings
(cons 'misc-error "^duplicate bindings"))
(define exception:bad-body (define exception:bad-body
(cons 'misc-error "^bad body")) (cons 'misc-error "^bad body"))
(define exception:bad-formals (define exception:bad-formals
@ -100,16 +102,19 @@
(let ((x 1)))) (let ((x 1))))
;; FIXME: Wouldn't one rather expect a 'bad bindings' error? ;; FIXME: Wouldn't one rather expect a 'bad bindings' error?
;; Hmm, the body is bad as well, isn't it?
(pass-if-exception "(let)" (pass-if-exception "(let)"
exception:bad-body exception:bad-body
(let)) (let))
;; FIXME: Wouldn't one rather expect a 'bad bindings' error? ;; FIXME: Wouldn't one rather expect a 'bad bindings' error?
;; Hmm, the body is bad as well, isn't it?
(pass-if-exception "(let 1)" (pass-if-exception "(let 1)"
exception:bad-body exception:bad-body
(let 1)) (let 1))
;; FIXME: Wouldn't one rather expect a 'bad bindings' error? ;; FIXME: Wouldn't one rather expect a 'bad bindings' error?
;; Hmm, the body is bad as well, isn't it?
(pass-if-exception "(let (x))" (pass-if-exception "(let (x))"
exception:bad-body exception:bad-body
(let (x)))) (let (x))))
@ -130,10 +135,12 @@
(pass-if-exception "(let ((1 2)) 3)" (pass-if-exception "(let ((1 2)) 3)"
exception:bad-var exception:bad-var
(let ((1 2)) 3)) (let ((1 2)) 3)))
(expect-fail-exception "(let ((x 1) (x 2)) x)" (with-test-prefix "duplicate bindings"
exception:bad-bindings
(pass-if-exception "(let ((x 1) (x 2)) x)"
exception:duplicate-bindings
(let ((x 1) (x 2)) x)))) (let ((x 1) (x 2)) x))))
(with-test-prefix "named let" (with-test-prefix "named let"
@ -149,6 +156,7 @@
(let x ((y 1)))) (let x ((y 1))))
;; FIXME: Wouldn't one rather expect a 'bad bindings' error? ;; FIXME: Wouldn't one rather expect a 'bad bindings' error?
;; Hmm, the body is bad as well, isn't it?
(pass-if-exception "(let x (y))" (pass-if-exception "(let x (y))"
exception:bad-body exception:bad-body
(let x (y))))) (let x (y)))))
@ -166,16 +174,19 @@
(let* ((x 1)))) (let* ((x 1))))
;; FIXME: Wouldn't one rather expect a 'bad bindings' error? ;; FIXME: Wouldn't one rather expect a 'bad bindings' error?
;; Hmm, the body is bad as well, isn't it?
(pass-if-exception "(let*)" (pass-if-exception "(let*)"
exception:bad-body exception:bad-body
(let*)) (let*))
;; FIXME: Wouldn't one rather expect a 'bad bindings' error? ;; FIXME: Wouldn't one rather expect a 'bad bindings' error?
;; Hmm, the body is bad as well, isn't it?
(pass-if-exception "(let* 1)" (pass-if-exception "(let* 1)"
exception:bad-body exception:bad-body
(let* 1)) (let* 1))
;; FIXME: Wouldn't one rather expect a 'bad bindings' error? ;; FIXME: Wouldn't one rather expect a 'bad bindings' error?
;; Hmm, the body is bad as well, isn't it?
(pass-if-exception "(let* (x))" (pass-if-exception "(let* (x))"
exception:bad-body exception:bad-body
(let* (x)))) (let* (x))))
@ -204,10 +215,12 @@
(pass-if-exception "(let* ((1 2)) 3)" (pass-if-exception "(let* ((1 2)) 3)"
exception:bad-var exception:bad-var
(let* ((1 2)) 3)) (let* ((1 2)) 3)))
(expect-fail-exception "(let* ((x 1) (x 2)) x)" (with-test-prefix "duplicate bindings"
exception:bad-bindings
(pass-if-exception "(let* ((x 1) (x 2)) x)"
exception:duplicate-bindings
(let* ((x 1) (x 2)) x)))) (let* ((x 1) (x 2)) x))))
(with-test-prefix "letrec" (with-test-prefix "letrec"
@ -230,16 +243,19 @@
(letrec ((x 1)))) (letrec ((x 1))))
;; FIXME: Wouldn't one rather expect a 'bad bindings' error? ;; FIXME: Wouldn't one rather expect a 'bad bindings' error?
;; Hmm, the body is bad as well, isn't it?
(pass-if-exception "(letrec)" (pass-if-exception "(letrec)"
exception:bad-body exception:bad-body
(letrec)) (letrec))
;; FIXME: Wouldn't one rather expect a 'bad bindings' error? ;; FIXME: Wouldn't one rather expect a 'bad bindings' error?
;; Hmm, the body is bad as well, isn't it?
(pass-if-exception "(letrec 1)" (pass-if-exception "(letrec 1)"
exception:bad-body exception:bad-body
(letrec 1)) (letrec 1))
;; FIXME: Wouldn't one rather expect a 'bad bindings' error? ;; FIXME: Wouldn't one rather expect a 'bad bindings' error?
;; Hmm, the body is bad as well, isn't it?
(pass-if-exception "(letrec (x))" (pass-if-exception "(letrec (x))"
exception:bad-body exception:bad-body
(letrec (x)))) (letrec (x))))
@ -268,10 +284,12 @@
(pass-if-exception "(letrec ((1 2)) 3)" (pass-if-exception "(letrec ((1 2)) 3)"
exception:bad-var exception:bad-var
(letrec ((1 2)) 3)) (letrec ((1 2)) 3)))
(expect-fail-exception "(letrec ((x 1) (x 2)) x)" (with-test-prefix "duplicate bindings"
exception:bad-bindings
(pass-if-exception "(letrec ((x 1) (x 2)) x)"
exception:duplicate-bindings
(letrec ((x 1) (x 2)) x)))) (letrec ((x 1) (x 2)) x))))
(with-test-prefix "if" (with-test-prefix "if"