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

« back to all changes in this revision

Viewing changes to ansi-tests/cell-error-name.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:  Mon Jan 27 22:36:48 2003
 
4
;;;; Contains: Tests of CELL-ERROR-NAME
 
5
 
 
6
(in-package :cl-test)
 
7
 
 
8
(deftest cell-error-name.1
 
9
  (handler-case
 
10
   (eval 'my-unbound-variable)
 
11
   (cell-error (c) (cell-error-name c)))
 
12
  my-unbound-variable)
 
13
 
 
14
(deftest cell-error-name.2
 
15
  (handler-case
 
16
   (eval '(my-undefined-function))
 
17
   ;; (warning (c) (muffle-warning c))
 
18
   (cell-error (c) (cell-error-name c)))
 
19
  my-undefined-function)
 
20
 
 
21
(deftest cell-error-name.3
 
22
  (cell-error-name (make-condition 'unbound-variable :name 'x))
 
23
  x)
 
24
  
 
25
(deftest cell-error-name.4
 
26
  (cell-error-name (make-condition 'undefined-function :name 'f))
 
27
  f)
 
28
  
 
29
(deftest cell-error-name.5
 
30
  (cell-error-name (make-condition 'unbound-slot :name 's))
 
31
  s)
 
32
 
 
33
(deftest cell-error-name.6
 
34
  (let ((i 0))
 
35
    (values
 
36
     (cell-error-name (progn (incf i) (make-condition
 
37
                                       'unbound-slot :name 's)))
 
38
     i))
 
39
  s 1)
 
40
 
 
41
  
 
42
;;; Need test raising condition unbound-slot
 
43
 
 
44
 
 
45
(deftest cell-error-name.error.1
 
46
  (signals-error (cell-error-name) program-error)
 
47
  t)
 
48
 
 
49
(deftest cell-error-name.error.2
 
50
  (signals-error (cell-error-name (make-condition 'unbound-variable :name 'foo) nil)
 
51
                 program-error)
 
52
  t)