1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 19:50:24 +02:00

* tests/syntax.test: Added test cases for 'cond =>' syntax with

else clause.  Changed some tests and comments related to the
'case' form to reflect recent changes in the implementation.
This commit is contained in:
Dirk Herrmann 2001-10-18 21:59:29 +00:00
parent 8ea4624953
commit b461abe73f
2 changed files with 20 additions and 8 deletions

View file

@ -1,3 +1,9 @@
2001-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
* tests/syntax.test: Added test cases for 'cond =>' syntax with
else clause. Changed some tests and comments related to the
'case' form to reflect recent changes in the implementation.
2001-10-14 Dirk Herrmann <D.Herrmann@tu-bs.de> 2001-10-14 Dirk Herrmann <D.Herrmann@tu-bs.de>
* tests/syntax.test: Added test cases for 'lambda' syntax. * tests/syntax.test: Added test cases for 'lambda' syntax.

View file

@ -370,6 +370,16 @@
(with-test-prefix "cond =>" (with-test-prefix "cond =>"
(with-test-prefix "else is handled correctly"
(pass-if "else =>"
(let ((=> 'foo))
(eq? (cond (else =>)) 'foo)))
(pass-if "else => identity"
(let* ((=> 'foo))
(eq? (cond (else => identity)) identity))))
(with-test-prefix "bad formals" (with-test-prefix "bad formals"
(pass-if-exception "=> (lambda (x 1) 2)" (pass-if-exception "=> (lambda (x 1) 2)"
@ -384,18 +394,16 @@
exception:bad/missing-clauses exception:bad/missing-clauses
(case)) (case))
;; FIXME: Wouldn't one rather expect a 'bad or missing clauses' error?
(pass-if-exception "(case . \"foo\")" (pass-if-exception "(case . \"foo\")"
exception:wrong-type-arg exception:bad/missing-clauses
(case . "foo")) (case . "foo"))
(pass-if-exception "(case 1)" (pass-if-exception "(case 1)"
exception:bad/missing-clauses exception:bad/missing-clauses
(case 1)) (case 1))
;; FIXME: Wouldn't one rather expect a 'bad or missing clauses' error?
(pass-if-exception "(case 1 . \"foo\")" (pass-if-exception "(case 1 . \"foo\")"
exception:wrong-type-arg exception:bad/missing-clauses
(case 1 . "foo")) (case 1 . "foo"))
(pass-if-exception "(case 1 \"foo\")" (pass-if-exception "(case 1 \"foo\")"
@ -419,18 +427,16 @@
;; exception:bad/missing-clauses ;; exception:bad/missing-clauses
;; (case 1 (() "bar"))) ;; (case 1 (() "bar")))
;; FIXME: Wouldn't one rather expect a 'bad or missing clauses' error?
(pass-if-exception "(case 1 ((2) \"bar\") . \"foo\")" (pass-if-exception "(case 1 ((2) \"bar\") . \"foo\")"
exception:wrong-type-arg exception:bad/missing-clauses
(case 1 ((2) "bar") . "foo")) (case 1 ((2) "bar") . "foo"))
(pass-if-exception "(case 1 (else #f) ((1) #t))" (pass-if-exception "(case 1 (else #f) ((1) #t))"
exception:bad/missing-clauses exception:bad/missing-clauses
(case 1 ((2) "bar") (else))) (case 1 ((2) "bar") (else)))
;; FIXME: Wouldn't one rather expect a 'bad or missing clauses' error?
(pass-if-exception "(case 1 (else #f) . \"foo\")" (pass-if-exception "(case 1 (else #f) . \"foo\")"
exception:wrong-type-arg exception:bad/missing-clauses
(case 1 (else #f) . "foo")) (case 1 (else #f) . "foo"))
(pass-if-exception "(case 1 (else #f) ((1) #t))" (pass-if-exception "(case 1 (else #f) ((1) #t))"