Skip to content

Commit

Permalink
Merge pull request #74 from SiberzK/fix-rustic-cargo-test
Browse files Browse the repository at this point in the history
Fix RUSTIC-CARGO-TEST
  • Loading branch information
psibi authored Jan 12, 2025
2 parents e5c0271 + b88a7e3 commit 1a38bb4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions rustic-cargo.el
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,21 @@ If ARG is not nil, use value as argument and store it in
`rustic-popup-mode', always use the value of
`rustic-test-arguments'."
(interactive "P")
(when arg
(setq rustic-test-arguments
(read-from-minibuffer "Cargo test arguments: "
(rustic--populate-minibuffer
(list (rustic-cargo-package-argument)
rustic-test-arguments
rustic-cargo-build-arguments
rustic-default-test-arguments)))))
(rustic-cargo-test-run rustic-test-arguments))
(rustic-cargo-test-run
(cond (arg
(setq rustic-test-arguments
(read-from-minibuffer "Cargo test arguments: "
(rustic--populate-minibuffer
(list (rustic-cargo-package-argument)
rustic-test-arguments
rustic-cargo-build-arguments
rustic-default-test-arguments)))))
(rustic-cargo-use-last-stored-arguments
(if (> (length rustic-test-arguments) 0)
rustic-test-arguments
rustic-default-test-arguments))
(t
rustic-default-test-arguments))))

;;;###autoload
(defun rustic-cargo-test-rerun ()
Expand Down
2 changes: 1 addition & 1 deletion test/rustic-cargo-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ fn test() {
(should (eq major-mode 'rustic-cargo-test-mode)))
(should (string= (s-join " " (process-get proc 'command))
(s-trim (concat (rustic-cargo-bin) " test "
rustic-test-arguments))))))))
rustic-default-test-arguments))))))))

(ert-deftest rustic-cargo-expand-test ()
(let* ((string "fn main() {()}")
Expand Down

0 comments on commit 1a38bb4

Please sign in to comment.