X-Git-Url: http://git.kpe.io/?p=xlunit.git;a=blobdiff_plain;f=result.lisp;h=80f411a7aab49ca343251cc9f144af6215cb2bb4;hp=eb49d0fc3773fb557c84e2cc581d918ff5066317;hb=HEAD;hpb=6e195606e06173086a91616042adef3072633d92 diff --git a/result.lisp b/result.lisp index eb49d0f..80f411a 100644 --- a/result.lisp +++ b/result.lisp @@ -2,7 +2,7 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; ID: $Id: result.lisp,v 1.6 2003/08/04 19:31:34 kevin Exp $ +;;;; ID: $Id$ ;;;; Purpose: Result functions for XLUnit ;;;; ;;;; ************************************************************************* @@ -31,7 +31,9 @@ (defmethod start-test ((tcase test) (res test-results)) (incf (run-tests res)) - (mapc (lambda (listener) (start-test listener tcase)) (listeners res)) + (mapc (lambda (listener) + (start-test listener tcase)) + (listeners res)) res) (defmethod end-test ((tcase test) (res test-results)) @@ -47,23 +49,23 @@ (defclass test-failure () ((failed-test :initarg :failed-test :reader failed-test) (thrown-condition :initarg :thrown-condition - :reader thrown-condition)) + :reader thrown-condition)) (:documentation "Stored failures/errors in test-results slots")) (defun make-test-failure (test condition) (make-instance 'test-failure :failed-test test - :thrown-condition condition)) + :thrown-condition condition)) (defmethod is-failure ((failure test-failure)) "Returns T if a failure was a test-failure condition" - (typep (thrown-condition failure) 'test-failure-condition)) + (typep (thrown-condition failure) 'assertion-failed)) (defmethod print-object ((obj test-failure) stream) (print-unreadable-object (obj stream :type t :identity nil) (format stream "~A: " (failed-test obj)) - (apply #'format stream - (simple-condition-format-control (thrown-condition obj)) - (simple-condition-format-arguments (thrown-condition obj))))) + (apply #'format stream + (simple-condition-format-control (thrown-condition obj)) + (simple-condition-format-arguments (thrown-condition obj))))) (defmethod was-successful ((result test-results)) "Returns T if a result has no failures or errors" @@ -77,13 +79,13 @@ (defmethod add-error ((ob test-results) (tcase test-case) condition) (push (make-test-failure tcase condition) (errors ob)) (mapc #'(lambda (single-listener) - (add-error single-listener tcase condition)) - (listeners ob))) + (add-error single-listener tcase condition)) + (listeners ob))) (defmethod add-failure ((ob test-results) (tcase test-case) condition) (push (make-test-failure tcase condition) (failures ob)) (mapc #'(lambda (single-listener) - (add-failure single-listener tcase condition)) - (listeners ob))) + (add-failure single-listener tcase condition)) + (listeners ob)))