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

Hard to read diff #5

Open
rluvaton opened this issue Jul 11, 2024 · 6 comments
Open

Hard to read diff #5

rluvaton opened this issue Jul 11, 2024 · 6 comments

Comments

@rluvaton
Copy link

rluvaton commented Jul 11, 2024

Currently, it's tough to read the diff in case of assertion failure, it would be great if it could use pretty_assertions under the hood or similar

@joelparkerhenderson
Copy link
Member

Super idea. I'll take a look. What do you think about owo-colors? https://crates.io/crates/owo-colors

Do you code rust? I would be fully open to PRs that add owo-colors, or a color solution that can work with no_std and also lets the user opt-in/opt-out via environment variable. (This is important because the asserts must be able to run in no_std, and must also be able to run in line-oriented CI/CD servers which compare line output snapshots)

@dzmitry-lahoda
Copy link

dzmitry-lahoda commented Nov 18, 2024

imho for me issue not in colors, but in output. it seems harder to read than builtin assert_eq! for example.
anyway, if there will be funding.json in crypto, will donate 77 USDC equivalent in any crypto for better output (as good as builtin assert_eq, specifically for assert_le/ge/gt/lt)

@dzmitry-lahoda
Copy link

next is hard to read for numbers:

assert_le!(new_supply, *old_supply);

next does not output numbers at all:

assert_le!(new_supply, *old_supply, "new total supply of any token does not grow until rollup action");

for me.

@joelparkerhenderson
Copy link
Member

Thank you for your generous offer. Great feedback. I'll take a look. Estimate 24-48 hours for a progress update here.

@joelparkerhenderson
Copy link
Member

joelparkerhenderson commented Nov 19, 2024

next does not output numbers at all:

Fixed. Can you update to to version 9.4.0?

Now the output should show is the custom message first, then all the regular assertion failure information.

@dzmitry-lahoda
Copy link

Fixed. Can you update to to version 9.4.0?

Thanks, it worked.

Thank you for your generous offer.

I am think if I bought app like this just to take care of my time. If it will save me a day of test debug/read in year - it payed off.
I coded some comparison like that several times, need them again, but do not have capacity to maintain shared solution as crate.

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

No branches or pull requests

3 participants