File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
rackunit-lib/rackunit/private Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 172172 (display-delimiter)))
173173
174174(define (display-raised-message v)
175- (if (exn? v)
176- (when (not (equal? (exn-message v) "" ))
177- (newline)
178- (displayln (exn-message v)))
179- (printf "\nA value other than an exception was raised: ~e\n " v)))
175+ (cond
176+ [(exn:test? v)
177+ (when (not (equal? (exn-message v) "" ))
178+ (newline)
179+ (displayln (exn-message v)))]
180+ [(exn:fail? v)
181+ (define sp (open-output-string))
182+ (parameterize ([current-error-port sp])
183+ ((error-display-handler) (exn-message v) v))
184+ (display " " )
185+ (display (regexp-replace* #rx"\n(.) " (get-output-string sp) "\n \\1 " ))]
186+ [else
187+ (printf "\nA value other than an exception was raised: ~e\n " v)]))
180188
181189(define (display-delimiter) (displayln "-------------------- " ))
182190
You can’t perform that action at this time.
0 commit comments