Commit 8412195b authored by Daniel Kochmański's avatar Daniel Kochmański

ctypecase: fix invalid tests (constant assignment)

Signed-off-by: Daniel Kochmański's avatarDaniel Kochmański <daniel@turtleware.eu>
parent 1d1edbc1
......@@ -99,9 +99,15 @@
(return-from done 'good)))
good)
;;; Test that explicit calls to macroexpand in subforms
;;; are done in the correct environment
;; Following tests (ctypecase.15 and ctypecase.16) are invalid, since
;; ctypecase provides restart, which evaluates to assignment to :foo,
;; which is constant. Both tests were transformed into valid ones and
;; moved to typecase.lsp (typecase.22 and typecase.23).
;;
;; Related discussion:
;; https://mailman.common-lisp.net/pipermail/ansi-test-devel/2012-January/000108.html
#+(or)
(deftest ctypecase.15
(macrolet
((%m (z) z))
......@@ -112,6 +118,7 @@
(symbol :bad2)))
:good)
#+(or)
(deftest ctypecase.16
(macrolet
((%m (z) z))
......
......@@ -142,6 +142,25 @@
(t (expand-in-current-env (%m :bad2)))))
:good)
(deftest typecase.22
(macrolet
((%m (z) z))
(typecase
(expand-in-current-env (%m :foo))
(integer :bad1)
(keyword :good)
(symbol :bad2)))
:good)
(deftest typecase.23
(macrolet
((%m (z) z))
(typecase :foo
(integer (expand-in-current-env (%m :bad1)))
(keyword (expand-in-current-env (%m :good)))
(symbol (expand-in-current-env (%m :bad2)))))
:good)
;;; Error cases
(deftest typecase.error.1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment