-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcell-error-name.lsp
52 lines (40 loc) · 1.22 KB
/
cell-error-name.lsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Mon Jan 27 22:36:48 2003
;;;; Contains: Tests of CELL-ERROR-NAME
(in-package :cl-test)
(deftest cell-error-name.1
(handler-case
(eval 'my-unbound-variable)
(cell-error (c) (cell-error-name c)))
my-unbound-variable)
(deftest cell-error-name.2
(handler-case
(eval '(my-undefined-function))
;; (warning (c) (muffle-warning c))
(cell-error (c) (cell-error-name c)))
my-undefined-function)
(deftest cell-error-name.3
(cell-error-name (make-condition 'unbound-variable :name 'x))
x)
(deftest cell-error-name.4
(cell-error-name (make-condition 'undefined-function :name 'f))
f)
(deftest cell-error-name.5
(cell-error-name (make-condition 'unbound-slot :name 's))
s)
(deftest cell-error-name.6
(let ((i 0))
(values
(cell-error-name (progn (incf i) (make-condition
'unbound-slot :name 's)))
i))
s 1)
;;; Need test raising condition unbound-slot
(deftest cell-error-name.error.1
(signals-error (cell-error-name) program-error)
t)
(deftest cell-error-name.error.2
(signals-error (cell-error-name (make-condition 'unbound-variable :name 'foo) nil)
program-error)
t)