Commit 68c204ce authored by pfdietz's avatar pfdietz

Changed apply.6 to apply.order.1. Added more error, cerror tests.

parent 202b1736
......@@ -43,12 +43,15 @@
(apply 'cons '(a b))
(a . b))
(deftest apply.6
(let ((x 0) y z)
(deftest apply.order.1
(let ((i 0) x y z)
(values
(apply (progn (setf y (incf x))
#'identity)
(progn (setf z (incf x))
(apply (progn (setf x (incf i))
#'list)
(progn (setf y (incf i))
'b)
(progn (setf z (incf i))
(list 'a)))
x y z))
a 2 1 2)
i x y z))
(b a) 3 1 2 3)
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sat Feb 15 19:45:27 2003
;;;; Contains: Tests of CERROR
(in-package :cl-test)
(deftest cerror.1
(let ((fmt "Cerror"))
(handler-case (cerror "Keep going." fmt)
(simple-error (c)
(and
(null (simple-condition-format-arguments c))
(eqt (simple-condition-format-control c)
fmt)))))
t)
(deftest cerror.2
(let* ((fmt "Cerror")
(cnd (make-condition 'simple-error :format-control fmt)))
(handler-case (cerror "Continue on." cnd)
(simple-error (c)
(and (eqt c cnd)
(eqt (simple-condition-format-control c)
fmt)))))
t)
(deftest cerror.3
(let ((fmt "Cerror"))
(handler-case (cerror "Continue" 'simple-error :format-control fmt)
(simple-error (c)
(eqt (simple-condition-format-control c)
fmt))))
t)
(deftest cerror.4
(let ((fmt "Cerror: ~A"))
(handler-case (cerror "On on" fmt 10)
(simple-error (c)
(and
(equalt
(simple-condition-format-arguments c)
'(10))
(eqt (simple-condition-format-control c)
fmt)))))
t)
(deftest cerror.5
(let ((fmt (formatter "Cerror")))
(handler-case (cerror "Keep going." fmt)
(simple-error (c)
(and
(null (simple-condition-format-arguments c))
(eqt (simple-condition-format-control c)
fmt)))))
t)
;;; Continuing from a cerror
(deftest cerror.6
(handler-bind ((simple-error #'(lambda (c) (continue c))))
(progn
(cerror "Wooo" 'simple-error)
10))
10)
......@@ -9,8 +9,10 @@
(let ((fmt "Error"))
(handler-case (error fmt)
(simple-error (c)
(eqt (simple-condition-format-control c)
fmt))))
(and
(null (simple-condition-format-arguments c))
(eqt (simple-condition-format-control c)
fmt)))))
t)
(deftest error.2
......@@ -31,5 +33,26 @@
fmt))))
t)
(deftest error.4
(let ((fmt "Error: ~A"))
(handler-case (error fmt 10)
(simple-error (c)
(and
(equalt
(simple-condition-format-arguments c)
'(10))
(eqt (simple-condition-format-control c)
fmt)))))
t)
(deftest error.5
(let ((fmt (formatter "Error")))
(handler-case (error fmt)
(simple-error (c)
(and
(null (simple-condition-format-arguments c))
(eqt (simple-condition-format-control c)
fmt)))))
t)
......@@ -109,6 +109,7 @@
(load "cell-error-name.lsp")
(load "assert.lsp")
(load "error.lsp")
(load "cerror.lsp")
;;; Tests of conses
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment