diff --git a/ansi-tests/case.lsp b/ansi-tests/case.lsp new file mode 100644 index 0000000000000000000000000000000000000000..6b3a21b8a9b5fbec001656a800b6b320f8806f29 --- /dev/null +++ b/ansi-tests/case.lsp @@ -0,0 +1,97 @@ +;-*- Mode: Lisp -*- +;;;; Author: Paul Dietz +;;;; Created: Fri Oct 18 19:56:44 2002 +;;;; Contains: Tests of CASE + +(in-package :cl-test) + +(deftest case.1 + (case 'a) + nil) + +(deftest case.2 + (case 10 (10 'a)) + a) + +(deftest case.3 + (case (copy-seq "abc") ("abc" 'a)) + nil) + +(deftest case.4 + (case 'z ((a b c) 1) + ((d e) 2) + ((f z g) 3) + (t 4)) + 3) + +(deftest case.5 + (case (1+ most-positive-fixnum) + (#.(1+ most-positive-fixnum) 'a)) + a) + +(deftest case.6 + (case nil (nil 'a) (t 'b)) + b) + +(deftest case.7 + (case nil ((nil) 'a) (t 'b)) + a) + +(deftest case.8 + (case 'a (b 0) (a (values 1 2 3)) (t nil)) + 1 2 3) + +(deftest case.9 + (case 'c (b 0) (a (values 1 2 3)) (t (values 'x 'y 'z))) + x y z) + +(deftest case.10 + (case 'z (b 1) (a 2) (z (values)) (t nil))) + +(deftest case.11 + (case 'z (b 1) (a 2) (t (values)))) + +(deftest case.12 + (case t (a 10)) + nil) + +(deftest case.13 + (case t ((t) 10) (t 20)) + 10) + +(deftest case.14 + (let ((x (list 'a 'b))) + (eval `(case (quote ,x) ((,x) 1) (t 2)))) + 1) + +(deftest case.15 + (case 'otherwise ((t) 10)) + nil) + +(deftest case.16 + (case t ((otherwise) 10)) + nil) + +(deftest case.17 + (case 'a (b 0) (c 1) (otherwise 2)) + 2) + +(deftest case.18 + (case 'a (b 0) (c 1) ((otherwise) 2)) + nil) + +(deftest case.19 + (case 'a (b 0) (c 1) ((t) 2)) + nil) + +(deftest case.20 + (case #\a + ((#\b #\c) 10) + ((#\d #\e #\A) 20) + (() 30) + ((#\z #\a #\y) 40)) + 40) + + + + diff --git a/ansi-tests/gclload2.lsp b/ansi-tests/gclload2.lsp index c9b1bbf87b1395cc183af5c0f4b53b600886fa37..010758fba7320b7e1e404544fb84a3098b21321f 100644 --- a/ansi-tests/gclload2.lsp +++ b/ansi-tests/gclload2.lsp @@ -14,6 +14,7 @@ (load "and.lsp") (load "block.lsp") (load "call-arguments-limit.lsp") +(load "case.lsp") (load "catch.lsp") (load "constantly.lsp") (load "complement.lsp") @@ -33,6 +34,7 @@ (load "function.lsp") (load "functionp.lsp") (load "identity.lsp") +(load "if.lsp") (load "labels.lsp") (load "lambda-list-keywords.lsp") (load "lambda-parameters-limit.lsp") @@ -47,7 +49,10 @@ (load "some.lsp") (load "t.lsp") (load "tagbody.lsp") +(load "unless.lsp") (load "unwind-protect.lsp") +(load "when.lsp") + ;;; Tests of conses diff --git a/ansi-tests/if.lsp b/ansi-tests/if.lsp new file mode 100644 index 0000000000000000000000000000000000000000..d2acdc28673ff9250239bd5f816fb3d03d47ea42 --- /dev/null +++ b/ansi-tests/if.lsp @@ -0,0 +1,32 @@ +;-*- Mode: Lisp -*- +;;;; Author: Paul Dietz +;;;; Created: Fri Oct 18 08:21:29 2002 +;;;; Contains: Tests for IF + +(in-package :cl-test) + +(deftest if.1 + (if t 1 2) + 1) + +(deftest if.2 + (if nil 1 2) + 2) + +(deftest if.3 (if t (values) 'a)) + +(deftest if.4 + (if nil 'a) + nil) + +(deftest if.5 + (if t (values 'a 'b 'c) 'd) + a b c) + +(deftest if.6 + (if nil 'a (values 'b 'c 'd)) + b c d) + +(deftest if.7 (if nil 'a (values))) + + diff --git a/ansi-tests/unless.lsp b/ansi-tests/unless.lsp new file mode 100644 index 0000000000000000000000000000000000000000..f6c96eb9587732a251e08302f9f6ba718b134c79 --- /dev/null +++ b/ansi-tests/unless.lsp @@ -0,0 +1,50 @@ +;-*- Mode: Lisp -*- +;;;; Author: Paul Dietz +;;;; Created: Fri Oct 18 19:39:34 2002 +;;;; Contains: Tests of UNLESS + +(in-package :cl-test) + +(deftest unless.1 + (unless t) + nil) + +(deftest unless.2 + (unless nil) + nil) + +(deftest unless.3 + (unless 'b 'a) + nil) + +(deftest unless.4 + (unless nil 'a) + a) + +(deftest unless.5 (unless nil (values))) + +(deftest unless.6 + (unless nil (values 1 2 3 4)) + 1 2 3 4) + +(deftest unless.7 + (unless 1 (values)) + nil) + +(deftest unless.8 + (unless #() (values 1 2 3 4)) + nil) + +(deftest unless.9 + (let ((x 0)) + (values + (unless nil + (incf x) + 'a) + x)) + a 1) + + + + + diff --git a/ansi-tests/when.lsp b/ansi-tests/when.lsp new file mode 100644 index 0000000000000000000000000000000000000000..edcd2d34aa53441446e31f094cb1f65411fb9951 --- /dev/null +++ b/ansi-tests/when.lsp @@ -0,0 +1,38 @@ +;-*- Mode: Lisp -*- +;;;; Author: Paul Dietz +;;;; Created: Fri Oct 18 19:36:57 2002 +;;;; Contains: Tests of WHEN + +(in-package :cl-test) + +(deftest when.1 + (when t) + nil) + +(deftest when.2 + (when nil 'a) + nil) + +(deftest when.3 (when t (values))) + +(deftest when.4 + (when t (values 'a 'b 'c 'd)) + a b c d) + +(deftest when.5 + (when nil (values)) + nil) + +(deftest when.6 + (when nil (values 'a 'b 'c 'd)) + nil) + +(deftest when.7 + (let ((x 0)) + (values + (when t (incf x) 'a) + x)) + a 1) + + +