X-Git-Url: http://git.kpe.io/?p=xlunit.git;a=blobdiff_plain;f=printer.lisp;h=8cfeab9f7c3c8aba3a6a28d5fe298b0f9bb9cbdf;hp=ad351c8e7012efa88fef24a670b541c9bedc6acc;hb=b889ac95ba72db60faa35fe08b360aaa33a795ed;hpb=e2bf8174193c9acc013b8bbbc116b7e7acc86526 diff --git a/printer.lisp b/printer.lisp index ad351c8..8cfeab9 100644 --- a/printer.lisp +++ b/printer.lisp @@ -2,7 +2,7 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; ID: $Id: printer.lisp,v 1.6 2003/08/05 22:56:25 kevin Exp $ +;;;; ID: $Id: printer.lisp,v 1.7 2003/08/10 07:39:33 kevin Exp $ ;;;; Purpose: Printer functions for XLUnit ;;;; ;;;; ************************************************************************* @@ -30,22 +30,26 @@ (let ((count (length defects))) (if (= 1 count) (format (ostream obj) "~%There was 1 ~A:~%" title) - (format (ostream obj) "~%There were ~D A:~%" + (format (ostream obj) "~%There were ~D ~A:~%" count title)) (dotimes (i count) (let* ((defect (nth i defects)) (condition (thrown-condition defect))) (format (ostream obj) "~A) ~A: " (1+ i) (name (failed-test defect))) - (apply #'format (ostream obj) - (simple-condition-format-control condition) - (simple-condition-format-arguments condition)) - (format (ostream obj) "~%") - (when (message condition) - (let ((spaces (+ 2 (length (format nil "~D" count))))) - (dotimes (i spaces) - (write-char #\space (ostream obj)))) - (format (ostream obj) "~A~%" (message condition)))))))) + (typecase condition + (assertion-failed + (apply #'format (ostream obj) + (simple-condition-format-control condition) + (simple-condition-format-arguments condition)) + (format (ostream obj) "~%") + (when (message condition) + (let ((spaces (+ 2 (length (format nil "~D" count))))) + (dotimes (i spaces) + (write-char #\space (ostream obj)))) + (format (ostream obj) "~A~%" (message condition)))) + (t + (format (ostream obj) "~A~%" condition)))))))) (defmethod print-footer ((obj textui-test-runner) result)