-
Notifications
You must be signed in to change notification settings - Fork 2.7k
WIP: wrote 3 tests about improving the error message in the path dependency #16138
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
base: master
Are you sure you want to change the base?
WIP: wrote 3 tests about improving the error message in the path dependency #16138
Conversation
…directory and invalid_manifest_in_path
| .file("crates/bar/src/lib.rs", "") | ||
| .build(); | ||
|
|
||
| p.cargo("check") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| p.cargo("check") | |
| p.cargo("generate-lockfile") |
Since these tests don't need building, this should make them run faster
| error: no matching package named `definitely_not_bar` found at `bar/` | ||
| note: required by package `foo v0.1.0 (/Users/eric/Temp/foo)` | ||
| help: package `bar` exists at `bar/` | ||
| "#]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a Draft, I appreciate showing your intent in shopping this around.
As you work on this, I'd recommend making the tests pass, showing the current behavior. Your next commit would then change Cargo's behavior and update the tests to show the new test output.
| ) | ||
| .run(); | ||
| } | ||
| // #[cargo_test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be commented out
What does this PR try to resolve?
This PR is trying to improve the error message when the wrong package is found in the path dependency. Currently the PR started from the tests.
How to test and review this PR?
There are 3 tests added that cover each case that is brought up in this issue.
invalid_package_name_in_path()definitely_not_barexists in thecrates/barand it goes to thecrates/barto find that it is not present there and it gives the error.invalid_package_in_subdirectory()definitely_not_barexists in thecrates/barand after going there, it does not find it. Then it goes more deeper in thedefinitely_not_barto find that the manifest file exists there and give use the helpful message.invalid_manifest_in_path()definitely_not_barexists in thecrates/barbut after going there, it finds that there are other two packages butdefinitely_not_baris not present and it gives the message.