-
Notifications
You must be signed in to change notification settings - Fork 384
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
Fix rust#cargotest namespace search #613
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you for this, LGTM though you need to update the expectations in spec/cargotest_spec.vim. Let me know if you need a hand with this.
The position.file property seems to often be just a file name; for files like mod.rs this would throw an error due to the way the special casing was set up; to fix this (and to assist with building the full module path for 'nearest' and 'file' tests) I've expanded to the full path (which is what the code seems to have been expecting). Next, with the full path to the file in hand, the way it searched for Cargo.toml would just not work on macOS (at least) since it would look like, eg: `Users/name/path/to/Cargo.toml`, which `glob()` would treat as relative, and so not match. To fix this in a (hopefully) platform-agnostic way, I've pulled out the prefix before the first "modules" entry and prepended it to the proposed path.
e016ed6
to
f4eb920
Compare
Hi @codeinabox sorry for the long delay—I've been a bit busy with Real Life and this fell off my radar. I found some time recently to finally figure out how to run the unit tests, and investigated this a bit further. It seems like the reason the unit tests work fine but I run into errors in practical use is I can probably proceed with updating the fixtures/tests to pass using my approach here of forcing absolute paths, but I wonder if there are other runners that have this brittleness, assuming |
Also it seems that vim-flavor v3.0.0 doesn't work anymore due to changes on github's side:
Locally, I had to install a newer version of ruby and install the latest |
Thank you for spotting this, I have fixed the build |
@dhleong keen to get this merged in though there is still one failing test, could you please look into this and let me know if you need a hand |
@codeinabox Sorry for the delay, I've been totally swamped and this keeps
falling off my radar. I suspect that the actual issue here was just from me
being unaware of the `test#project_root` config, and the implications of
it. I don't know if/when I'll have a chance to confirm this, but I suspect
that there's actually no change needed here, so long as the project root is
configured the way vim-test expects.
…On Wed, Sep 14, 2022, 8:16 AM Mathew Attlee ***@***.***> wrote:
@dhleong <https://github.com/dhleong> keen to get this merged in though
there is still one failing test, could you please look into this and let me
know if you need a hand
—
Reply to this email directly, view it on GitHub
<#613 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGHIFSBH2S4UPLUUM7W2QTV6G6ZRANCNFSM5K5DNY6A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The position.file property seems to often be just a file name; for files
like mod.rs this would throw an error due to the way the special casing
was set up; to fix this (and to assist with building the full module
path for 'nearest' and 'file' tests) I've expanded to the full path
(which is what the code seems to have been expecting).
Next, with the full path to the file in hand, the way it searched for
Cargo.toml would just not work on macOS (at least) since it would look
like, eg:
Users/name/path/to/Cargo.toml
, whichglob()
would treat asrelative, and so not match. To fix this in a (hopefully)
platform-agnostic way, I've pulled out the prefix before the first
"modules" entry and prepended it to the proposed path.
Make sure these boxes are checked before submitting your pull request:
doc/test.txt