~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to ansi-tests/eval.lsp

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
  (signals-error (eval (list (gensym))) undefined-function)
 
51
  t)