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

rustic-cargo-current-test is broken for running all tests in a module #561

Open
cebernard opened this issue May 8, 2024 · 1 comment
Open

Comments

@cebernard
Copy link

When running rustic-current-test with point on (or just under) a test module, the resulting argument passed to 'cargo test' is just the module name, which doesn't seem to work as desired.

Since test modules are usually named "tests", they're not unique. The resulting behavior is that instead of that just test module's tests getting run, all unit tests in the crate get run.

More broadly, no module's tests get run when tests are in their own file.

What I would like to see is this: If point is above all a module's test functions, run those and only those tests, regardless of whether point is in a separate tests file or in a production file.

If you're interested, I'd be happy to submit a PR for this.

Thanks!

@cebernard
Copy link
Author

I'll break up this feature into 3 PRs for easier review. The first will add unique module scoping for running tests when defined in production files, the second when defined in separate files, and third will be for clean up (I noticed a fair bit of duplication and confusion in the unit tests that I'd like to address).

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.

1 participant