Closed anergictcell closed 1 year ago
Addendum: I did check the command line that is called to run doctest:
rustdoc \
--edition=2021 \
--crate-type lib \
--crate-name lsp_doctest \
--test lsp-doctest/src/lib.rs \
-L dependency=lsp-doctest/target/debug/deps \
-L dependency=lsp-doctest/target/debug/deps \
--test-args DoesntWork::foo \
--nocapture \
--extern lsp_doctest=lsp-doctest/target/debug/deps/liblsp_doctest-60746c6531973132.rlib -C embed-bitcode=no \
--error-format human
The DoesntWork::foo
filtering returns 0 results, because the test should be called DoesntWork<'a>::foo
In order to manually run the test on the command line, one needs to run:
cargo test -- DoesntWork\<\'a\>::foo
and escape the redirect <
and >
characters as well as the single quote '
This command comes from the rust-analyzer, not generated by this plugin. If it is generating the wrong command it will need to be fixed upstream.
I tested this same test case in VSCode's rust-analyzer plugin and it behaves the same way so this will likely need to be reported upstream https://github.com/rust-lang/rust-analyzer
Thanks for the quick response. I opened an issue on rust-analyzer now (https://github.com/rust-lang/rust-analyzer/issues/14142)
I cannot run the doctests from SublimeText directly when a struct contains a lifetime parameter.
Code to reproduce:
Clicking the "Run Doctest" for the
Works
struct works with the following result:Clicking the "Run Doctest" for the
DoesntWork
struct does not work and returns the following result:Maybe this is related to the fact that the test is called
DoesntWork<'a>::foo
? and the'
somewhat breaks the test command? Is there a way to see the actual command that SublimeText executes? The tests work when run from the command line: