make use-debugger actually allow the debugger to get called with the4/head
authorRuss Tyndall <russ@acceleration.net>
Tue, 30 Oct 2012 19:46:35 +0000 (30 15:46 -0400)
committerRuss Tyndall <russ@acceleration.net>
Tue, 30 Oct 2012 19:46:37 +0000 (30 15:46 -0400)
original stack (use handler-bind instead of case)

lisp-unit.lisp

index 4f6528c..f30d769 100644 (file)
@@ -536,14 +536,15 @@ assertion.")
 (defun run-test-thunk (code)
   (let ((*pass* 0)
         (*fail* 0))
-    (handler-case (run-code code)
-      (error (condition)
-        (when *print-errors*
-          (print-error condition))
-        (if (use-debugger-p condition)
-            condition
-            (return-from run-test-thunk
-              (values *pass* *fail* :error)))))
+    (handler-bind
+        ((error (lambda (condition)
+                  (when *print-errors*
+                    (print-error condition))
+                  (if (use-debugger-p condition)
+                      condition
+                      (return-from run-test-thunk
+                        (values *pass* *fail* :error condition))))))
+      (run-code code))
     ;; Return the result count
     (values *pass* *fail* nil)))