rackunit icon indicating copy to clipboard operation
rackunit copied to clipboard

Multi-line `string-info` isn't indented correctly

Open jackfirth opened this issue 1 year ago • 0 comments

This program:

#lang racket/base

(require rackunit)

(with-check-info (['multiline-string (string-info "hello\nworld")])
  (check-equal? 1 2))

Produces this failure message:

--------------------
FAILURE
multiline-string:
  hello
world
name:              check-equal?
location:          3-unsaved-editor:6:2
actual:            1
expected:          2
--------------------

But it should produce this:

--------------------
FAILURE
multiline-string:
  hello
  world
name:              check-equal?
location:          3-unsaved-editor:6:2
actual:            1
expected:          2
--------------------

Note the difference in indentation in the world line of text. Rackunit used to do this, and I relied on it for good error messages in my tests of Resyntax since those tests use string-info to embed the source code blocks in the test failure messages whenever Resyntax fails to fix code correctly. I'm not sure when this stopped working, but it worked in 2021 when I first made Resyntax.

jackfirth avatar Aug 22 '24 02:08 jackfirth