anchor.diff:      (y-or-n-p "~A -- debug?" condition))
      (*use-debugger*)))
   
  -;;; Failure control strings
  -
  -(defgeneric print-failure (result)
  -  (:documentation
  -   "Report the results of the failed assertion."))
  -
  -(defmethod print-failure :around (result)
  -  "Failure header and footer output."
  -  (format t "~& | Failed Form: ~S" (form result))
  -  (call-next-method)
  -  (when (extras result)
  -    (format t "~{~& | ~S => ~S~}~%"
  -            (funcall (extras result))))
  -  (format t "~& |~%")
  -  (class-name result))
  -
  -(defmethod print-failure (result)
  -  (format t "~& | Expected ~{~S~^; ~} " (expected result))
  -  (format t "~<~% | ~:;but saw ~{~S~^; ~}~>" (actual result)))
  -
  -(defmethod print-failure ((result error-result))
  -  (format t "~& | ~@[Should have signalled ~{~S~^; ~} but saw~]"
  -          (expected result))
  -  (format t " ~{~S~^; ~}" (actual result)))
  -
  -(defmethod print-failure ((result macro-result))
  -  (format t "~& | Should have expanded to ~{~S~^; ~} "
  -          (expected result))
  -  (format t "~<~%~:;but saw ~{~S~^; ~}~>" (actual result)))
  -
  -(defmethod print-failure ((result output-result))
  -  (format t "~& | Should have printed ~{~S~^; ~} "
  -          (expected result))
  -  (format t "~<~%~:;but saw ~{~S~^; ~}~>"
  -          (actual result)))
  -
  -(defgeneric print-error (condition)
  -  (:documentation
  -   "Print the error condition."))
  -
  -(defmethod print-error (condition)
  -  "Print the error condition."
  -  (let ((*print-escape* nil))
  -    (format t "~& | Execution error:~% | ~W" condition)
  -    (format t "~& |~%")))
  -
  -(defun print-summary (name pass fail &optional exerr)
  -  "Print a summary of the test results."
  -  (format t "~&~A: ~S assertions passed, ~S failed"
  -          name (length pass) (length fail))
  -  (format t "~@[, ~S execution errors~].~2%" exerr))
  -
   ;;; Global unit test database
   
   (defparameter *test-db* (make-hash-table :test #'eq)
  
positive.code:    (create
      (setf (gethash package *tag-db*) (make-hash-table)))
     (t (warn "No tags defined for package: ~S" package))))
  
  (defclass unit-test ()
    ((doc
  
negative.code:   "Run the tests associated with the specified tags in package."
    (%run-thunks (tagged-tests tags package) package))
  
  ;;; Print failures
  
  (defgeneric print-failure (result)
    (:documentation
     "Report the results of the failed assertion."))
  
  (defmethod print-failure :around ((result assert-result))
    "Failure header and footer output."
    (format t "~& | Failed Form: ~S" (form result))
    (call-next-method)
    (when (extras result)
      (format t "~{~& | ~S => ~S~}~%"
              (funcall (extras result))))
    (format t "~& |~%")
    (class-name result))
  
  (defmethod print-failure ((result assert-result))
    (format t "~& | Expected ~{~S~^; ~} " (expected result))
    (format t "~<~% | ~:;but saw ~{~S~^; ~}~>" (actual result)))
  
  (defmethod print-failure ((result error-result))
    (format t "~& | ~@[Should have signalled ~{~S~^; ~} but saw~]"
            (expected result))
    (format t " ~{~S~^; ~}" (actual result)))
  
  (defmethod print-failure ((result macro-result))
    (format t "~& | Should have expanded to ~{~S~^; ~} "
            (expected result))
    (format t "~<~%~:;but saw ~{~S~^; ~}~>" (actual result)))
  
  (defmethod print-failure ((result output-result))
    (format t "~& | Should have printed ~{~S~^; ~} "
            (expected result))
    (format t "~<~%~:;but saw ~{~S~^; ~}~>"
            (actual result)))
  
  ;;; Print errors
  
  (defgeneric print-error (result)
    (:documentation
     "Print the error condition."))
  
  (defmethod print-error ((result test-result))
    "Print the error condition."
    (let ((*print-escape* nil))
      (format t "~& | Execution error:~% | ~W" (condition result))
      (format t "~& |~%")
      (print-summary result)))
  
  ;;; Useful equality predicates for tests
  
  ;;; (LOGICALLY-EQUAL x y) => true or false
  