From 6fde51f3d69aae024f2a7ab23574108ab4a61c07 Mon Sep 17 00:00:00 2001
From: pfdietz <pfdietz@localhost>
Date: Fri, 24 Jun 2005 00:03:14 +0000
Subject: [PATCH] Add separate tests for MAKE-CONDITION

---
 ansi-tests/load-conditions.lsp |  1 +
 ansi-tests/make-condition.lsp  | 44 ++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 ansi-tests/make-condition.lsp

diff --git a/ansi-tests/load-conditions.lsp b/ansi-tests/load-conditions.lsp
index 6cded241..4702c3b3 100644
--- a/ansi-tests/load-conditions.lsp
+++ b/ansi-tests/load-conditions.lsp
@@ -22,3 +22,4 @@
 (load "continue.lsp")
 (load "store-value.lsp")
 (load "use-value.lsp")
+(load "make-condition.lsp")
diff --git a/ansi-tests/make-condition.lsp b/ansi-tests/make-condition.lsp
new file mode 100644
index 00000000..82a38c05
--- /dev/null
+++ b/ansi-tests/make-condition.lsp
@@ -0,0 +1,44 @@
+;-*- Mode:     Lisp -*-
+;;;; Author:   Paul Dietz
+;;;; Created:  Thu Jun 23 11:54:10 2005
+;;;; Contains: Tests of MAKE-CONDITION
+
+(in-package :cl-test)
+
+
+(deftest make-condition.1
+  (loop for tp in *cl-condition-type-symbols*
+	for c = (make-condition tp)
+	unless (and (typep c tp)
+		    (typep c 'condition))
+	collect (list tp c))
+  nil)
+
+(deftest make-condition.2
+  (loop for tp in *cl-condition-type-symbols*
+	for class = (find-class tp)
+	for c = (and class (make-condition class))
+	unless (or (not class)
+		   (and (typep c tp)
+			(typep c class)
+			(typep c 'condition)))
+	collect (list tp c))
+  nil)
+
+(deftest make-condition.3
+  (let* ((tp '(or program-error type-error))
+	 (c (make-condition tp)))
+    (notnot-mv (typep c tp)))
+  t)
+
+(deftest make-condition.4
+  (let* ((tp '(and simple-error type-error))
+	 (c (make-condition tp)))
+    (notnot-mv (typep c tp)))
+  t)
+
+;;; Error tests
+
+(deftest make-condition.error.1
+  (signals-error (make-condition) program-error)
+  t)
-- 
GitLab