ignore-errors.lsp 716 Bytes
Newer Older
1 2 3 4 5
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sun Mar  2 20:38:25 2003
;;;; Contains: Tests of IGNORE-ERRORS

6

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

(deftest ignore-errors.1
  (ignore-errors)
  nil)

(deftest ignore-errors.2
  (ignore-errors 'a)
  a)

(deftest ignore-errors.3
  (ignore-errors (values 1 2 3 4 5 6 7 8))
  1 2 3 4 5 6 7 8)

(deftest ignore-errors.4
  (multiple-value-bind (val cond)
      (ignore-errors (error "foo"))
    (and (null val)
sds's avatar
sds committed
24 25
         (typep cond 'simple-error)
         t))
26 27 28 29 30 31 32 33 34 35 36 37 38
  t)

(deftest ignore-errors.5
  (handler-case
   (ignore-errors (signal "foo"))
   (condition () 'good))
  good)

(deftest ignore-errors.6
  (handler-case
   (ignore-errors (signal "foo"))
   (simple-condition () 'good))
  good)