anchor.diff:      :type list
       :initform ()
       :accessor missing-tests))
  -  (:default-initargs :test-names ())
     (:documentation
      "Store the results of the tests for further evaluation."))
   
  -(defmethod print-object ((object test-results) stream)
  +(defmethod print-object ((object test-results-db) stream)
     "Print the summary counts with the object."
  -  (format stream "#<~A Total(~D) Passed(~D) Failed(~D) Errors(~D)>~%"
  -          (class-name (class-of object))
  -          (+ (pass object) (fail object))
  -          (pass object) (fail object) (exerr object)))
  +  (let ((pass (pass object))
  +        (fail (fail object))
  +        (exerr (exerr object)))
  +    (format
  +     stream "#<~A Total(~D) Passed(~D) Failed(~D) Errors(~D)>~%"
  +     (class-name (class-of object))
  +     (+ pass fail) pass fail exerr)))
  +
  +(defun test-names (test-results-db)
  +  "Return a list of the test names in the database."
  +  (loop for name being each hash-key in (database test-results-db)
  +        collect name))
   
   (defun record-result (test-name code results)
     "Run the test code and record the result."
  -  (multiple-value-bind (pass fail exerr)
  -      (run-test-thunk code)
  -    (push test-name (test-names results))
  +  (let ((result (run-test-thunk code)))
  +    ;; Store the result
  +    (setf (gethash test-name (database results)) result)
       ;; Count passed tests
  -    (when (plusp pass)
  -      (incf (pass results) pass))
  -    ;; Count failed tests and record name
  -    (when (plusp fail)
  -      (incf (fail results) fail)
  +    (when (pass result)
  +      (incf (pass results) (length (pass result))))
  +    ;; Count failed tests and record the name
  +    (when (fail result)
  +      (incf (fail results) (length (fail result)))
         (push test-name (failed-tests results)))
  -    ;; Count errors and record name
  -    (when exerr
  +    ;; Count errors and record the name
  +    (when (exerr result)
         (incf (exerr results))
  -      (push test-name (error-tests results)))
  -    ;; Print a summary of the results
  -    (when (or *print-summary* *print-failures* *print-errors*)
  -      (print-summary
  -       test-name pass fail (when exerr 1)))))
  +      (push test-name (error-tests results)))))
   
   (defun summarize-results (results)
     "Print a summary of all results."
  
positive.code:   `(lambda ()
       (list ,@(mapcan (lambda (form) (list `',form form)) extras))))
  
  (defun internal-assert
         (type form code-thunk expected-thunk extras test)
    "Perform the assertion and record the results."
    (let* ((expected (multiple-value-list (funcall expected-thunk)))
           (actual (multiple-value-list (funcall code-thunk)))
           (passed (test-passed-p type expected actual test)))
      ;; Count the assertion
      (if passed
          (incf *pass*)
          (incf *fail*))
      ;; Report the assertion
      (when (and (not passed) *print-failures*)
        (print-failure
         *output-format* type form expected actual extras))
      ;; Return the result
      passed))
  
  ;;; Test passed predicate.
  
  (defgeneric test-passed-p (type expected actual test)
    (:documentation
     "Return the result of the test."))
  
  (defmethod test-passed-p ((type (eql :error)) expected actual test)
    "Return the result of the error assertion."
    (or
     (eql (car actual) (car expected))
     (typep (car actual) (car expected))))
  
  (defmethod test-passed-p ((type (eql :equal)) expected actual test)
    "Return the result of the equality assertion."
    (and
     (<= (length expected) (length actual))
     (every test expected actual)))
  
  (defmethod test-passed-p ((type (eql :macro)) expected actual test)
    "Return the result of the macro expansion."
    (equal (car actual) (car expected)))
  
  (defmethod test-passed-p ((type (eql :output)) expected actual test)
    "Return the result of the printed output."
    (string=
     (string-trim '(#\newline #\return #\space) (car actual))
     (car expected)))
  
  (defmethod test-passed-p ((type (eql :result)) expected actual test)
    "Return the result of the assertion."
    (logically-equal (car actual) (car expected)))
  
  ;;; Results
  
  (defclass test-results ()
    ((test-names
      :type list
      :initarg :test-names
      :accessor test-names)
     (pass
      :type fixnum
      :initform 0
  
negative.code: 
  ;;; Global counters
  
  (defparameter *pass* ()
    "The passed assertion results.")
  
  (defparameter *fail* ()
    "The failed assertion results.")
  
  ;;; Global options
  
  (defparameter *print-summary* nil
    "Print a summary of the pass, fail, and error count if non-nil.")
  