-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
cider-test
: don't render a newline between expected and actual
#3375
Conversation
For short results it looks better without the newline, but I wondering if it helps readability for multi-line results. Let me think a bit about this. |
Now that
|
Now the newline is inserted conditionally, following my previous comment. |
I also found no whitespace to look better for short results, as it's easier to eyeball differences that way. Perhaps Would it be possible to post a screenshot of a multiline output as well, @vemv? |
That indeed looks nicer! Just to clarify what I originally meant: we could also always have whitespace between More concretely, your example would then be:
That way we'd still benefit from the easier eyeballing of But, as bbatsov's mentions, I'm unsure how the lack of whitespace between actual and expected would play out when |
I meant the same @aisamu, but I don't feel strongly about this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can always change this down the road.
@vemv Just add some changelog entry and this one is good to go. |
Makes sense @aisamu - implemented! |
(let ((trimmed-string (replace-regexp-in-string "\n\\'" "" input-string))) | ||
(and (string-match-p "\n" trimmed-string) | ||
t)))) | ||
(and (string-match-p "\\n" input-string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this regexp really match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Escaped newlines as coming from Clojure / cider-nrepl. These aren't vanilla elisp newlines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It matches the letter "n" in a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Before:
After:
Personally I just didn't like this newline. For large reports it can make quite a difference.
Cheers - V