Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions rust-cargo.el
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,16 @@ output buffer will be in comint mode, i.e. interactive."
(interactive "P")
(rust--compile comint "%s run --release" rust-cargo-bin))

(defun rust-test ()
"Test using `cargo test`"
(interactive)
(rust--compile nil "%s test %s" rust-cargo-bin rust-cargo-default-arguments))
(defun rust-test (&optional arg)
"Test using `cargo test`.
If prefixed with `C-u`, pass additional arguments to the command (from a string read from the minibuffer)."
(interactive "P")
(let ((test-command (if arg
(concat "%s test "
(read-string "Enter Arguments: ") " %s")
"%s test %s"
"%s test %s")))
(rust--compile nil test-command rust-cargo-bin rust-cargo-default-arguments)))

(defun rust-run-clippy ()
"Run `cargo clippy'."
Expand Down