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

Does not fully work with pretty_assertions, fix OK? #109

Open
vriesk opened this issue Dec 7, 2022 · 2 comments · May be fixed by #110
Open

Does not fully work with pretty_assertions, fix OK? #109

vriesk opened this issue Dec 7, 2022 · 2 comments · May be fixed by #110

Comments

@vriesk
Copy link

vriesk commented Dec 7, 2022

Hoi,

If one uses assert_eq! or assert_ne! macros inside closures defined inside a #[test_case(...)], the drop-in replacement method provided by the pretty_assertions won't work, as the compilation fails on ambiguous resolution of those from use super::* here and the ::std provided one.

The solution would be to simply add a feature-guarded use ::pretty_assertions::{assert_eq, assert_ne} after the line above. Would not need test_case to depend on pretty_assertions even.

Would you accept a PR for that?

@luke-biel
Copy link
Collaborator

Hi. Sorry that took so much time to answer, but I wanted to think about the issue and also review possible solutions. I'm not fond of adding a dependency or feature related to particular crates within test-case.
I'm looking for something inbetween, where'd you define per-crate replacement for assert_eq and assert_ne macros, but I need to see how viable it is first. Will come back to you once I have a PoC, but if you have an opinion already, then it's most welcome.

@luke-biel
Copy link
Collaborator

@luke-biel luke-biel linked a pull request Dec 14, 2022 that will close this issue
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 a pull request may close this issue.

2 participants