On error, show a condition report instead of a condition object.
authorChris Hanson <org/chris-hanson/cph>
Tue, 19 Nov 2019 06:45:25 +0000 (22:45 -0800)
committerChris Hanson <org/chris-hanson/cph>
Wed, 20 Nov 2019 03:05:55 +0000 (19:05 -0800)
src/libraries/inline-testing.scm

index 760bf494a4aa191158b37dc43e23f57223a399d4..700e6ea7a0f0e05bad1becf5ea06c06846b56e19 100644 (file)
@@ -64,6 +64,7 @@ USA.
                call-with-output-string
                call-with-truncated-output-string
                call-with-truncated-output-string
+               condition/report-string
                condition?
                default-object
                default-object?
@@ -288,7 +289,7 @@ USA.
 (define (show-failing-result failure)
   (newline)
   (newline)
-  (display "evaluating ")
+  (display "evaluating")
   (newline)
   (pp (car failure))
   (display "failed the following expectations:")
@@ -331,7 +332,7 @@ USA.
     (lambda (context . args)
       (if (context 'is-error?)
          (string-append "Expected non-error but instead got error: "
-                        (write-to-string (context 'get-condition)))
+                        (condition/report-string (context 'get-condition)))
          (apply handler (context 'get-value) args)))))
 
 (define (define-output-expectation keyword n-args handler)
@@ -339,7 +340,7 @@ USA.
     (lambda (context . args)
       (if (context 'is-error?)
          (string-append "Expected non-error but instead got error: "
-                        (write-to-string (context 'get-condition)))
+                        (condition/report-string (context 'get-condition)))
          (let ((objects (read-objects (context 'get-port))))
            (if (condition? objects)
                "Error while reading output"