rackunit
rackunit copied to clipboard
pretty-printing in test failures does not seem to indent enough
In this program:
#lang racket
(require rackunit)
(check-equal? (make-list 20 'xxxx) #f)
I see this output:
--------------------
. FAILURE
name: check-equal?
location: 34-unsaved-editor:3:0
actual:
'(xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx)
expected: #f
--------------------
I think the lines with the xxxx
in them (except the first one) need to be two more spaces to the right.
FWIW, here's code that indents exception printing.
https://github.com/racket/rackunit/commit/1c4730dab73354c2afa743213d2f2f7ff640e9f3
I think printing a value would require doing something similar, unless we can specify to racket/pretty
directly that it needs to indent text further.
FWIW, here's code that indents exception printing.
I think printing a value would require doing something similar, unless we can specify to
racket/pretty
directly that it needs to indent text further.
This code looks okay to me. The problematic code should be the code that calls pretty-print
, I think. That is, I expect the issue to be the way racket/pretty
is used, as you say.
The call to pretty-print
is in rackunit/private/check-info
and there is some configuration of parameters in rackunit/private/format
.