Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMore readable assert_eq proposal #1866
Conversation
This comment has been minimized.
This comment has been minimized.
p-kraszewski
commented on 7e7d12d
Jan 23, 2017
•
Perhaps it might be feasible to extend |
This comment has been minimized.
This comment has been minimized.
|
I think panics in general could benefit from a multi-line scheme |
aturon
added
the
T-libs
label
Jan 23, 2017
This comment has been minimized.
This comment has been minimized.
|
@jethrogb While I wouldn't want to block this focused PR over that, yes, in general I'd love to see panics handled more gracefully. I don't want to encourage people to use |
This comment has been minimized.
This comment has been minimized.
ExpHP
commented
Jan 24, 2017
|
Do note that textual diffs (mis)take the map for the territory; I don't think should be a deal breaker; but it is a limitation which spells diminishing returns for text-based strategies. Compared to textual diffs, the linebreaks and 1-space alignment in the RFC provide quite a bit more bang to the buck. |
This comment has been minimized.
This comment has been minimized.
|
I think we should only do string based diffing for strings, other types could have their own algorithms. |
This comment has been minimized.
This comment has been minimized.
ExpHP
commented
Jan 24, 2017
Unfortunately that would require a new trait bound for This is something that could be experimented with in a third party crate though. |
This comment has been minimized.
This comment has been minimized.
cjxgm
commented
Feb 1, 2017
|
Should we generally not put too many words into the panic message?
|
aturon
self-assigned this
Feb 28, 2017
aturon
assigned
BurntSushi
and unassigned
BurntSushi and
aturon
Mar 28, 2017
This comment has been minimized.
This comment has been minimized.
|
Punting to @BurntSushi, sorry for the very long delay :( |
This comment has been minimized.
This comment has been minimized.
|
Thank you :) |
This comment has been minimized.
This comment has been minimized.
|
@rfcbot fcp merge |
This comment has been minimized.
This comment has been minimized.
|
@lpil Thanks so much for this! I think the libs team is generally in favor of this, and we think this could probably could have squeak its way through as a PR. However, we should just move forward with the RFC since it is already written. :-)
|
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Apr 11, 2017
•
|
Team member @BurntSushi has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
This comment has been minimized.
This comment has been minimized.
|
Might be a bit late but I think this would be great and really plays into the ergonomics goal of Rust in 2017. I'm in favor of it. If it could look like the Elixir example given in the RFC I'd prefer that personally but LLVM style arrows is good too if that's not possible yet. |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Apr 17, 2017
|
|
rfcbot
added
the
final-comment-period
label
Apr 17, 2017
This comment has been minimized.
This comment has been minimized.
colin-kiegel
commented
Apr 19, 2017
|
The RFC should also address How would those LLVM style arrows look like, if both left/right expressions wrap around several lines and the difference is somewhere in the middle? Would that still be readable and look good? Just as a sidenote: The quick [-red-]{+brown+} fox jumps over the lazy dogMaybe printing a diff in this style could be a colorless alternative to LLVM style arrows, but it might become less readable or even ambiguous if the underlying text contains a lot of special characters, too. Alternatively, inspecting/printing the diff of the debug outputs could be left to a third party crate like |
This comment has been minimized.
This comment has been minimized.
|
I've had a chance to use |
casey
referenced this pull request
Apr 21, 2017
Closed
Switch to rust-pretty-assertions for assertions #165
This comment has been minimized.
This comment has been minimized.
CajetanP
commented
Apr 22, 2017
|
It clearly is a major improvement which will surely make using Rust even more comfortable than it currently is. I don't see any reason why it shouldn't be approved. As mentioned above, colours would be great but we can settle for LLVM style arrows if that's currently not possible. |
This comment has been minimized.
This comment has been minimized.
colin-kiegel
commented
Apr 22, 2017
•
|
I think |
This comment has been minimized.
This comment has been minimized.
dlight
commented
Apr 26, 2017
Specialization provides a backwards compatible manner to add this feature: create a new trait |
This comment has been minimized.
This comment has been minimized.
Eh2406
commented
Apr 26, 2017
|
Note that this has been discussed before: https://users.rust-lang.org/t/suggestions-for-better-test-output/7494 |
carols10cents
added this to FCP
in Tracker
Apr 26, 2017
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Apr 27, 2017
|
The final comment period is now complete. |
aturon
referenced this pull request
Apr 29, 2017
Open
Tracking issue for RFC 1866: More readable assert_eq #41615
This comment has been minimized.
This comment has been minimized.
|
This RFC has now been merged! Discussion should move to the tracking issue. I added a couple of unresolved questions, one of them for For some reason github isn't recognizing the merge, so I'm going to manually close, but the official RFC is here. |
aturon
closed this
Apr 29, 2017
colin-kiegel
referenced this pull request
Apr 29, 2017
Open
panics with new lines are not matched #85
colin-kiegel
added a commit
to colin-kiegel/rust-pretty-assertions
that referenced
this pull request
Apr 29, 2017
This comment has been minimized.
This comment has been minimized.
|
Thank you :) |
This comment has been minimized.
This comment has been minimized.
vitiral
commented
May 7, 2017
|
This is not strickly related to the RFC -- I think this is a great first step! -- but do you think we could have a new traits related to the I ask because this is really great for comparing strings but does almost nothing in those extremely common cases. Again, super happy to see this change! |
lpil commentedJan 23, 2017
Rendered
Improve
assert_eqfailure message formatting to increase legibilityA continuation of #1864.