rackunit
rackunit copied to clipboard
Multi-line `string-info` isn't indented correctly
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.