Skip to content
Snippets Groups Projects
Commit 8412195b authored by Daniel Kochmański's avatar Daniel Kochmański
Browse files

ctypecase: fix invalid tests (constant assignment)

parent 1d1edbc1
No related branches found
No related tags found
No related merge requests found
...@@ -99,9 +99,15 @@ ...@@ -99,9 +99,15 @@
(return-from done 'good))) (return-from done 'good)))
good) good)
;;; Test that explicit calls to macroexpand in subforms ;; Following tests (ctypecase.15 and ctypecase.16) are invalid, since
;;; are done in the correct environment ;; 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 (deftest ctypecase.15
(macrolet (macrolet
((%m (z) z)) ((%m (z) z))
...@@ -112,6 +118,7 @@ ...@@ -112,6 +118,7 @@
(symbol :bad2))) (symbol :bad2)))
:good) :good)
#+(or)
(deftest ctypecase.16 (deftest ctypecase.16
(macrolet (macrolet
((%m (z) z)) ((%m (z) z))
......
...@@ -142,6 +142,25 @@ ...@@ -142,6 +142,25 @@
(t (expand-in-current-env (%m :bad2))))) (t (expand-in-current-env (%m :bad2)))))
:good) :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 ;;; Error cases
(deftest typecase.error.1 (deftest typecase.error.1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment