From 3dbea58704ee19efc734049513fac026780c86d7 Mon Sep 17 00:00:00 2001 From: pfdietz <pfdietz@localhost> Date: Mon, 3 Mar 2003 02:47:59 +0000 Subject: [PATCH] Load handler-case.lsp; add ignore-errors.lsp --- ansi-tests/handler-case.lsp | 24 ++++++++++++++------- ansi-tests/ignore-errors.lsp | 38 ++++++++++++++++++++++++++++++++++ ansi-tests/load-conditions.lsp | 3 +++ 3 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 ansi-tests/ignore-errors.lsp diff --git a/ansi-tests/handler-case.lsp b/ansi-tests/handler-case.lsp index 2440500b..dc0e7fb5 100644 --- a/ansi-tests/handler-case.lsp +++ b/ansi-tests/handler-case.lsp @@ -181,11 +181,19 @@ (error () 'good)) good) - - - - - - - - +(deftest handler-case.26 + (handler-case + (values 1 'a 1.0) + (error () 'bad) + (:no-error (a b c) + ;; Test that declarations can go here + (declare (type integer a)) + (declare (type symbol b)) + (declare (type number c)) + (declare (ignore a c)) + b)) + a) + +(deftest handler-case.27 + (handler-case (error "foo") (error ())) + nil) diff --git a/ansi-tests/ignore-errors.lsp b/ansi-tests/ignore-errors.lsp new file mode 100644 index 00000000..b01223fc --- /dev/null +++ b/ansi-tests/ignore-errors.lsp @@ -0,0 +1,38 @@ +;-*- Mode: Lisp -*- +;;;; Author: Paul Dietz +;;;; Created: Sun Mar 2 20:38:25 2003 +;;;; Contains: Tests of IGNORE-ERRORS + +(in-package :cl-test) + +(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) + (typep cond 'simple-error) + t)) + 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) diff --git a/ansi-tests/load-conditions.lsp b/ansi-tests/load-conditions.lsp index 936a05d8..d8c90610 100644 --- a/ansi-tests/load-conditions.lsp +++ b/ansi-tests/load-conditions.lsp @@ -8,3 +8,6 @@ (load "warn.lsp") (load "invoke-debugger.lsp") (load "handler-bind.lsp") +(load "handler-case.lsp") +(load "ignore-errors.lsp") + -- GitLab