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

Replace newline chars with newlines in test report #3281

Merged
merged 1 commit into from
Jan 5, 2023

Conversation

expez
Copy link
Member

@expez expez commented Dec 6, 2022

When the library / app under test returns long error messages on test
failures it will often include newlines. These are today displayed as
\\n and we get an error message on one very long line.

This commit turns these newline characters into actual newlines, which
makes the content of the *cider-test-report* buffer much more pleasant
to read.

Before:

image

After:
image

;; messages more readable
(goto-char (point-min))
(while (search-forward "\\n" nil t)
(replace-match "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, is there something else you can use that's visually clearer? I'm guessing an \n doesn't work, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing an \n doesn't work, right?

Correct

@bbatsov
Copy link
Member

bbatsov commented Dec 6, 2022

I'm okay with the fix, but it also needs a changelog entry. A regression test that verifies that this conversation works would be appreciated as well.

@expez
Copy link
Member Author

expez commented Dec 6, 2022

I'm okay with the fix, but it also needs a changelog entry.

Pushed

A regression test [..] would be appreciated as well.

Is there an existing file for these tests, where I can insert a few choice lines?

@bbatsov
Copy link
Member

bbatsov commented Dec 6, 2022

Not sure - I don't see a cider-test.el in the tests, but it might be because it would have had the same name as the implementation file.

@bbatsov
Copy link
Member

bbatsov commented Dec 16, 2022

You'll also need to rebase on top of master.

@bbatsov
Copy link
Member

bbatsov commented Jan 4, 2023

@expez Can you at least rebase this on top of master? Even without a test it's a fix that I'd like to merge.

When the library / app under test returns long error messages on test
failures it will often include newlines.  These are today displayed as
`\\n` and we get an error message on one very long line.

This commit turns these newline characters into actual newlines, which
makes the content of the `*cider-test-report*` buffer much more pleasant
to read.
@expez
Copy link
Member Author

expez commented Jan 5, 2023

@bbatsov done.

Sorry about the slow response, travel and Christmas holiday got in the way.

Happy new year!

@bbatsov
Copy link
Member

bbatsov commented Jan 5, 2023

Happy new year!

@bbatsov bbatsov merged commit ab54769 into master Jan 5, 2023
@bbatsov bbatsov deleted the newlines-in-error-reports branch January 5, 2023 12:31
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

Successfully merging this pull request may close these issues.

None yet

2 participants