Commit f7ac2fb2 authored by pfdietz's avatar pfdietz

Tests inspired by a random tester failure in gcl. Note that according

to section 5.1.3 of CLtS, the value in the place in these setf-like forms is
retrieved *after* the following forms.  Most lisps got this wrong.
parent d1359565
......@@ -160,3 +160,12 @@
(progn (setf y (incf i)) 0)))
i x y a))
9 2 1 2 #(9 2 3 4))
(deftest decf.order.4
(let ((x 0))
(progn
"See CLtS 5.1.3"
(values
(decf x (setf x 1))
x)))
0 0)
......@@ -161,5 +161,12 @@
i x y a))
11 2 1 2 #(11 2 3 4))
(deftest incf.order.4
(let ((x 0))
(progn
"See CLtS 5.1.3"
(values
(incf x (setf x 1))
x)))
2 2)
......@@ -47,6 +47,13 @@
#(a b c d)
3)
(deftest push.order.3
(let ((x '(a b c)))
(values
(push (progn (setq x '(d e)) 'z) x)
x))
(z d e) (z d e))
(def-macro-test push.error.1 (push x y))
;;; Need to add push vs. various accessors
......@@ -215,6 +215,13 @@
#(a b c d e)
4)
(deftest pushnew.order.3
(let ((x '(a b c)))
(values
(pushnew (progn (setq x '(d e)) 'z) x)
x))
(z d e) (z d e))
(deftest pushnew.error.1
(signals-error
(let ((x '(a b)))
......
......@@ -52,4 +52,13 @@
pa))
nil #((:a 1) nil (:c 3) (:d 4)))
(deftest remf.order.3
(let ((x (list 'a 'b 'c 'd)))
(progn
"See CLtS 5.1.3"
(values
(remf x (progn (setq x (list 'e 'f)) 'a))
x)))
nil (e f))
(def-macro-test remf.error.1 (remf x 'a))
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