source: trunk/source/tests/ansi-tests/eval.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: 963 bytes
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Thu Nov 21 10:43:15 2002
4;;;; Contains: Tests of EVAL
5
6(in-package :cl-test)
7
8(deftest eval.1
9  (eval 1)
10  1)
11
12(deftest eval.2
13  (loop for x being the symbols of "KEYWORD"
14        always (eq (eval x) x))
15  t)
16
17(deftest eval.3
18  (let ((s "abcd"))
19    (eqlt (eval s) s))
20  t)
21
22(deftest eval.4
23  (eval '(car '(a . b)))
24  a)
25
26(deftest eval.5
27  (eval '(let ((x 0)) x))
28  0)
29
30(deftest eval.6
31  (funcall #'eval 1)
32  1)
33
34(deftest eval.order.1
35  (let ((i 0))
36    (values (eval (progn (incf i) 10)) i))
37  10 1)
38
39;;; Error cases
40
41(deftest eval.error.1
42  (signals-error (eval) program-error)
43  t)
44
45(deftest eval.error.2
46  (signals-error (eval nil nil) program-error)
47  t)
48
49(deftest eval.error.3
50  (let ((v (gensym)))
51    (eval `(signals-error (eval (list ',v)) undefined-function
52                          :name ,v)))
53  t)
54
55(deftest eval.error.4
56  (let ((v (gensym)))
57    (eval `(signals-error (eval ',v) unbound-variable :name ,v)))
58  t)
Note: See TracBrowser for help on using the repository browser.