Closed isvilen closed 6 months ago
@isvilen Looks good to me apart from minor comment. But for this to be merged, this would need two more updates:
I've updated the README file, but I can find any existing tests for rust-cargo.el
, so I am not sure how to add a test for this feature.
so I am not sure how to add a test for this feature.
We have some tests for it in rustic mode for cargo-run etc: https://github.com/emacs-rustic/rustic/blob/17a79c659b0eb304e35705facb114caf61eae2e9/test/rustic-cargo-test.el#L6
Can you see if you can adapt it from there ? It's okay if it's a separate file.
@psibi Added tests for rust-compile
and rust-run
in interactive and non-interactive mode.
@isvilen Thanks, it works and I tested it locally too with a few different program.
Although I was not successful with the test-project/src/main.rs
: How do you ensure when running using rust-run
that args.len() != 1
since I don't see a way to pass a parameter to cargo run
itself.
Probably I'm missing something since I mostly use rustic
and rust-mode
has different way to pass an option ?
@isvilen Thanks, it works and I tested it locally too with a few different program.
Although I was not successful with the
test-project/src/main.rs
: How do you ensure when running usingrust-run
thatargs.len() != 1
since I don't see a way to pass a parameter tocargo run
itself.Probably I'm missing something since I mostly use
rustic
andrust-mode
has different way to pass an option ?
I just set rust-cargo-default-arguments
before invoking rust-run
see https://github.com/rust-lang/rust-mode/blob/947ebf993818f7135e12d4b0da6f5b05ba790c14/rust-cargo-tests.el#L47
Thank you!
thanks you both for that @psibi @isvilen 💯
If universal argument is set before invoking
rust-run
(C-u C-c C-c C-r)
the output buffer will be inComint
mode withcompilation-shell-minor-mode
and user input can be processed.