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

Expand test modules #20

Closed
gnzlbg opened this issue Nov 13, 2017 · 2 comments
Closed

Expand test modules #20

gnzlbg opened this issue Nov 13, 2017 · 2 comments

Comments

@gnzlbg
Copy link

gnzlbg commented Nov 13, 2017

I am trying to expand some macros inside #[cfg(test)] mod tests { .... } modules and failing.

I have tried: cargo expand --tests, cargo expand --test path/to/file.rs, cargo expand --test file, cargo expand test` (like cargo test but with expand), without any luck.

I've also tried by copying the relevant code into tests/file.rs and trying to cargo expand --test tests/file.rs instead.

@dtolnay
Copy link
Owner

dtolnay commented Nov 13, 2017

Expanding test code in the library requires passing --test to rustc (not to cargo). This should work: cargo expand -- --test.

@gnzlbg
Copy link
Author

gnzlbg commented Nov 13, 2017

Thanks, I managed to get it to work. I was doing cargo expand -h to get help and that was suggesting me to use just --test. It was very confusing.

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

2 participants