From 68c204ce092eb1f55948de06a685e9d20639d74b Mon Sep 17 00:00:00 2001 From: pfdietz <pfdietz@localhost> Date: Sun, 16 Feb 2003 02:03:55 +0000 Subject: [PATCH] Changed apply.6 to apply.order.1. Added more error, cerror tests. --- ansi-tests/apply.lsp | 17 ++++++----- ansi-tests/cerror.lsp | 66 +++++++++++++++++++++++++++++++++++++++++ ansi-tests/error.lsp | 27 +++++++++++++++-- ansi-tests/gclload2.lsp | 1 + 4 files changed, 102 insertions(+), 9 deletions(-) create mode 100644 ansi-tests/cerror.lsp diff --git a/ansi-tests/apply.lsp b/ansi-tests/apply.lsp index bca498ee..b403ff7a 100644 --- a/ansi-tests/apply.lsp +++ b/ansi-tests/apply.lsp @@ -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) + diff --git a/ansi-tests/cerror.lsp b/ansi-tests/cerror.lsp new file mode 100644 index 00000000..c5df50bc --- /dev/null +++ b/ansi-tests/cerror.lsp @@ -0,0 +1,66 @@ +;-*- 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) diff --git a/ansi-tests/error.lsp b/ansi-tests/error.lsp index b8374990..7e5c0e0d 100644 --- a/ansi-tests/error.lsp +++ b/ansi-tests/error.lsp @@ -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) diff --git a/ansi-tests/gclload2.lsp b/ansi-tests/gclload2.lsp index 3efe7d53..3730134d 100644 --- a/ansi-tests/gclload2.lsp +++ b/ansi-tests/gclload2.lsp @@ -109,6 +109,7 @@ (load "cell-error-name.lsp") (load "assert.lsp") (load "error.lsp") +(load "cerror.lsp") ;;; Tests of conses -- GitLab