Skip to content
Snippets Groups Projects
Commit b7f13d2f authored by pfdietz's avatar pfdietz
Browse files

More tests of ROTATEF.

parent 4da9c029
No related branches found
No related tags found
No related merge requests found
......@@ -25,4 +25,47 @@
#(a b c e f d)
5)
(deftest rotatef.1
(let ((x (vector 0 1 2)))
(values
(rotatef (aref x (aref x 0)) (aref x (aref x 1)) (aref x (aref x 2)))
x))
nil
#(1 2 0))
(deftest rotatef.2
(let ((x (vector 0 1 2 3 4 5 6 7 8 9)))
(values
(rotatef (aref x (aref x 0))
(aref x (aref x 1))
(aref x (aref x 2))
(aref x (aref x 3))
(aref x (aref x 4))
(aref x (aref x 5))
(aref x (aref x 6))
(aref x (aref x 7))
(aref x (aref x 8))
(aref x (aref x 9)))
x))
nil
#(1 2 3 4 5 6 7 8 9 0))
(deftest rotatef.3
(rotatef)
nil)
(deftest rotatef.4
(let ((x 10))
(values
x
(rotatef x)
x))
10 nil 10)
(deftest rotatef.5
(let ((x 'a) (y 'b))
(values x y (rotatef x y) x y))
a b nil b a)
;;; Need to add more tests for ROTATEF here
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