From d2bb17ce165242a28c0fe22ae2a98f0ed79d76fe Mon Sep 17 00:00:00 2001 From: Aankhen Date: Mon, 26 Jun 2017 18:38:14 +0530 Subject: Skip `rust-test-project-located' without cargo and avoid `find-file' in test. --- rust-mode-tests.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'rust-mode-tests.el') diff --git a/rust-mode-tests.el b/rust-mode-tests.el index 42792ac..1e03795 100644 --- a/rust-mode-tests.el +++ b/rust-mode-tests.el @@ -2651,13 +2651,11 @@ extern \"rust-intrinsic\" fn five() { "five")))) (ert-deftest rust-test-project-located () - (lexical-let* ((this-dir default-directory) - (test-dir (expand-file-name "test-project" this-dir)) + (skip-unless (executable-find "cargo")) + (lexical-let* ((test-dir (expand-file-name "test-project" default-directory)) (manifest-file (expand-file-name "Cargo.toml" test-dir))) - (find-file (expand-file-name "test-project/foo.rs")) - (unwind-protect - (should (equal (expand-file-name (rust-buffer-project)) manifest-file)) - (kill-buffer)))) + (let ((default-directory test-dir)) + (should (equal (expand-file-name (rust-buffer-project)) manifest-file))))) ;; If electric-pair-mode is available, load it and run the tests that use it. If not, ;; no error--the tests will be skipped. -- cgit v1.2.3