From 19a87ffe135691e07284b8f85ec9b8161ed0b8f8 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 5 Jan 2017 07:31:38 -0600 Subject: [PATCH] adjust 86a91d675d to bring back the "expression:" field of a failed test or, in other words, make a top-level check-equal? more like a check-equal? inside a test-suite that runs in verbose mode (except that a top-level one limits the output to error-print-width characters, but the one inside a test-suite doesn't seem to do that) --- rackunit-lib/rackunit/private/format.rkt | 8 ++++++-- rackunit-test/tests/rackunit/standalone.rkt | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/rackunit-lib/rackunit/private/format.rkt b/rackunit-lib/rackunit/private/format.rkt index e9e52f3..3e23483 100644 --- a/rackunit-lib/rackunit/private/format.rkt +++ b/rackunit-lib/rackunit/private/format.rkt @@ -84,6 +84,11 @@ (location->string (check-info-value info))) (λ (x) (printf "~a\n" x)))) + ((check-expression? info) + (display-check-info-name-value max-name-width + (check-info-name info) + (check-info-value info) + (λ (x) (printf "~.s\n" x)))) (else (display-check-info-name-value max-name-width (check-info-name info) @@ -96,8 +101,7 @@ ;; display-check-info-stack : (listof check-info) -> void (define (display-check-info-stack check-info-stack) (display-verbose-check-info-stack - (filter (λ (x) (not (check-expression? x))) - (strip-redundant-params check-info-stack))) + (strip-redundant-params check-info-stack)) (newline)) ;; display-test-name : (U string #f) -> void diff --git a/rackunit-test/tests/rackunit/standalone.rkt b/rackunit-test/tests/rackunit/standalone.rkt index f781611..971dfb4 100644 --- a/rackunit-test/tests/rackunit/standalone.rkt +++ b/rackunit-test/tests/rackunit/standalone.rkt @@ -49,6 +49,7 @@ FAILURE name: check location: standalone-check-test.rkt:48:0 params: (# 1 2) +expression: (check = 1 2) message: 0.0 Check failure @@ -75,6 +76,7 @@ name: check-eq? location: standalone-test-case-test.rkt:23:12 actual: 1 expected: 2 +expression: (check-eq? 1 2) Check failure -------------------- @@ -85,6 +87,7 @@ name: check-eq? location: standalone-test-case-test.rkt:24:21 actual: 1 expected: 2 +expression: (check-eq? 1 2) Check failure --------------------