Skip to content

Commit d2bb17c

Browse files
committed
Skip rust-test-project-located' without cargo and avoid find-file' in test.
1 parent b4077f8 commit d2bb17c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

rust-mode-tests.el

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,13 +2651,11 @@ extern \"rust-intrinsic\" fn five() {
26512651
"five"))))
26522652

26532653
(ert-deftest rust-test-project-located ()
2654-
(lexical-let* ((this-dir default-directory)
2655-
(test-dir (expand-file-name "test-project" this-dir))
2654+
(skip-unless (executable-find "cargo"))
2655+
(lexical-let* ((test-dir (expand-file-name "test-project" default-directory))
26562656
(manifest-file (expand-file-name "Cargo.toml" test-dir)))
2657-
(find-file (expand-file-name "test-project/foo.rs"))
2658-
(unwind-protect
2659-
(should (equal (expand-file-name (rust-buffer-project)) manifest-file))
2660-
(kill-buffer))))
2657+
(let ((default-directory test-dir))
2658+
(should (equal (expand-file-name (rust-buffer-project)) manifest-file)))))
26612659

26622660
;; If electric-pair-mode is available, load it and run the tests that use it. If not,
26632661
;; no error--the tests will be skipped.

0 commit comments

Comments
 (0)