Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pretty-printing in test failures does not seem to indent enough #159

Open
rfindler opened this issue Jul 18, 2022 · 3 comments
Open

pretty-printing in test failures does not seem to indent enough #159

rfindler opened this issue Jul 18, 2022 · 3 comments

Comments

@rfindler
Copy link
Member

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.

@sorawee
Copy link
Contributor

sorawee commented Jul 18, 2022

FWIW, here's code that indents exception printing.

1c4730d

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.

@rfindler
Copy link
Member Author

FWIW, here's code that indents exception printing.

1c4730d

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.

@samth
Copy link
Sponsor Member

samth commented Jul 19, 2022

The call to pretty-print is in rackunit/private/check-info and there is some configuration of parameters in rackunit/private/format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants