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

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

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

File size: 1.3 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Fri Oct 18 08:21:29 2002
4;;;; Contains: Tests for IF
5
6(in-package :cl-test)
7
8(deftest if.1
9  (if t 1 2)
10  1)
11
12(deftest if.2
13  (if nil 1 2)
14  2)
15
16(deftest if.3 (if t (values) 'a))
17
18(deftest if.4
19  (if nil 'a)
20  nil)
21
22(deftest if.5
23  (if t (values 'a 'b 'c) 'd)
24  a b c)
25
26(deftest if.6
27  (if nil 'a (values 'b 'c 'd))
28  b c d)
29
30(deftest if.7 (if nil 'a (values)))
31
32;;; Macros are expanded in the appropriate environment
33
34(deftest if.8
35  (macrolet ((%m (z) z))
36            (if (expand-in-current-env (%m t)) :good :bad))
37  :good)
38
39(deftest if.9
40  (macrolet ((%m (z) z))
41            (if (expand-in-current-env (%m nil)) :bad))
42  nil)
43
44(deftest if.10
45  (macrolet ((%m (z) z))
46            (if (expand-in-current-env (%m t)) :good))
47  :good)
48
49(deftest if.11
50  (macrolet ((%m (z) z))
51            (if (expand-in-current-env (%m nil)) :bad :good))
52  :good)
53
54(deftest if.12
55  (macrolet
56   ((%m (z) z))
57   (flet ((%f (x y) (if x (expand-in-current-env (%m y)))))
58         (declare (notinline %f))
59         (values (%f t :good) (%f nil :bad))))
60  :good nil)
61           
62(deftest if.13
63  (macrolet
64   ((%m (z) z))
65   (flet ((%f (x y z) (if x y (expand-in-current-env (%m z)))))
66         (declare (notinline %f))
67         (values (%f t :good :bad) (%f nil :bad :good))))
68  :good :good)     
69
70(deftest if.order.1
71  (let ((i 0))
72    (values (if (= (incf i) 1) 't nil) i))
73  t 1)
Note: See TracBrowser for help on using the repository browser.