From b7f13d2f9c1cee29285234eaeab0c0d9061bcc10 Mon Sep 17 00:00:00 2001 From: pfdietz <pfdietz@localhost> Date: Fri, 24 Oct 2003 08:59:51 +0000 Subject: [PATCH] More tests of ROTATEF. --- ansi-tests/rotatef.lsp | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/ansi-tests/rotatef.lsp b/ansi-tests/rotatef.lsp index 0743f96b..f4fafece 100644 --- a/ansi-tests/rotatef.lsp +++ b/ansi-tests/rotatef.lsp @@ -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 -- GitLab