source: trunk/source/tests/ansi-tests/or.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 1.2 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Fri Oct 18 07:29:27 2002
4;;;; Contains: Tests of OR
5
6(in-package :cl-test)
7
8(deftest or.1
9  (or)
10  nil)
11
12(deftest or.2
13  (or nil)
14  nil)
15
16(deftest or.3
17  (or 'a)
18  a)
19
20(deftest or.4
21  (or (values 'a 'b 'c))
22  a b c)
23
24(deftest or.5 (or (values)))
25
26(deftest or.6
27  (or (values t nil) 'a)
28  t)
29
30(deftest or.7
31  (or nil (values 'a 'b 'c))
32  a b c)
33
34(deftest or.8
35  (let ((x 0))
36    (values (or t (incf x))
37            x))
38  t 0)
39
40(deftest or.9
41  (or (values nil 1 2) (values 1 nil 2))
42  1 nil 2)
43
44;;; Test that explicit calls to macroexpand in subforms
45;;; are done in the correct environment
46
47(deftest or.10
48  (macrolet
49   ((%m (z) z))
50   (or (expand-in-current-env (%m 'x))
51       (expand-in-current-env (%m nil))
52       (expand-in-current-env (%m 'y))
53       t))
54  x)
55
56(deftest or.11
57  (macrolet
58   ((%m (z) z))
59   (or (expand-in-current-env (%m nil))
60       (expand-in-current-env (%m 'a))
61       nil))
62  a)       
63
64;;; Error tests
65
66(deftest or.error.1
67  (signals-error (funcall (macro-function 'or)) program-error)
68  t)
69
70(deftest or.error.2
71  (signals-error (funcall (macro-function 'or) '(or)) program-error)
72  t)
73
74(deftest or.error.3
75  (signals-error (funcall (macro-function 'or) '(or) nil nil) program-error)
76  t)
Note: See TracBrowser for help on using the repository browser.