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
Show only different part instead of the whole thing #99
Comments
I can see the potential use for this in some circumstances. However, I can also think of examples made much harder with this. For instance, consider the following data: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
] And then the following diff (from --- actual.list 2022-04-04 15:30:43.378492792 +0100
+++ expected.list 2022-04-04 15:30:35.886500826 +0100
@@ -13,7 +13,7 @@
0,
0,
0,
- 3,
+ 0,
0,
0,
0, Is this easier to debug by being shorter? Without a file to open and jump to line 13 in, I would say this is much harder. I think reasonably, displaying the shortened diff would have to be in addition to the complete diff. Which would necessarily make the whole output longer; which I'm not sure is what you want? |
That's exactly how https://github.com/mitsuhiko/similar-asserts#similar-asserts handles it. |
An option to opt-in would be great. use pretty_assertions::diff_only::assert_eq; |
When diffing 2 big objects which have a small difference in the middle, it's very hard to know what exactly gone wrong. I have to either scroll the terminal, or to redirect
cargo test
to a file and then useless
.So it would be nice to only display the difference, like
diff
tool does.The text was updated successfully, but these errors were encountered: