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

Make expect_eq and friends more hygienic #475

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eopb
Copy link

@eopb eopb commented Sep 3, 2024

Thanks for googletest-rust. It's been awesome to use 🙌

Currently, expect_that! doesn't work unless both verify_eq! and verify_that are in scope.

This is okay or users of the prelude, but not for those who don't.

I've noticed that googletest-rust has a number of other macro hygiene issues, but to avoid making an overly large PR, I'll address them as I come across them.

Currently, `expect_that!` doesn't work unless both `verify_eq!` and `verify_that` are in scope.

This is okay or users of the prelude, but not for those who don't.

I've noticed that googletest-rust has a number of other macro hygiene issue, but to avoid making an overly large PR, I'll address them as I come across them.
eopb added a commit to eopb/googletest-rust that referenced this pull request Sep 3, 2024
related google#475

I went for using fully qualified method names, rather than `use $crate::GoogleTestSupport as _;` since it's more hygienic.

`use $crate::GoogleTestSupport as _;` can cause issues, resulting in a conflict, if the user introduces another method with the same name as one on `GoogleTestSupport`
eopb added a commit to eopb/googletest-rust that referenced this pull request Sep 3, 2024
related google#475

I went for using fully qualified method names, rather than `use $crate::GoogleTestSupport as _;` since it's more hygienic.

`use $crate::GoogleTestSupport as _;` can cause issues, resulting in a conflict, if the user introduces another method with the same name as one on `GoogleTestSupport`
eopb added a commit to eopb/cargo-override that referenced this pull request Sep 4, 2024
This requires extra imports because googletest macros look for items in the local scope.

I've opened a PR to fix this google/googletest-rust#475

Once that is released, the extra imports will become unused.
eopb added a commit to eopb/cargo-override that referenced this pull request Sep 4, 2024
This requires extra imports because googletest macros look for items in the local scope.

I've opened a PR to fix this google/googletest-rust#475

Once that is released, the extra imports will become unused.
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 this pull request may close these issues.

1 participant