[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat b93ab4c0e0 2/6: Add test for executable-find
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat b93ab4c0e0 2/6: Add test for executable-find |
Date: |
Mon, 16 Jan 2023 11:57:29 -0500 (EST) |
branch: externals/compat
commit b93ab4c0e0cb7de245af18c675d4cfe53a3dac0a
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Add test for executable-find
---
compat-27.el | 2 +-
compat-tests.el | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/compat-27.el b/compat-27.el
index 12209ce7e7..41686f340a 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -445,7 +445,7 @@ the value of the variable `exec-path'."
(nreverse path)))))
(exec-path)))
-(compat-defun executable-find (command &optional remote) ;; <UNTESTED>
+(compat-defun executable-find (command &optional remote) ;;
<compat-tests:executable-find>
"Search for COMMAND in `exec-path' and return the absolute file name.
Return nil if COMMAND is not found anywhere in `exec-path'. If
REMOTE is non-nil, search on the remote host indicated by
diff --git a/compat-tests.el b/compat-tests.el
index 4da2e121d9..5d035f5b15 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1232,6 +1232,13 @@
(should-equal t (always 1)) ;; single argument
(should-equal t (always 1 2 3 4))) ;; multiple arguments
+(ert-deftest executable-find ()
+ (should (member (executable-find "sh") '("/usr/bin/sh" "/bin/sh")))
+ (should (member (executable-find "ls") '("/usr/bin/ls" "/bin/ls")))
+ ;; TODO These dummy calls are executed locally, test Tramp!
+ (should (member (compat-call executable-find "sh" t) '("/usr/bin/sh"
"/bin/sh")))
+ (should (member (compat-call executable-find "ls" t) '("/usr/bin/ls"
"/bin/ls"))))
+
(ert-deftest with-existing-directory ()
(let ((dir (make-temp-name "/tmp/not-exist-")))
(let ((default-directory dir))
@@ -1244,7 +1251,7 @@
(should-equal (temporary-file-directory) temporary-file-directory)
(let ((default-directory "/mnt"))
(should-equal (temporary-file-directory) default-directory))
- ;; TODO how can we test tramp?
+ ;; TODO Implement Tramp test
;;(let ((default-directory "/sudo:/"))
;; (should-equal (temporary-file-directory) temporary-file-directory))
;;(let ((default-directory "/ssh:does-not-exist:/"))
- [elpa] externals/compat updated (fcb99b1b1e -> 47953b014f), ELPA Syncer, 2023/01/16
- [elpa] externals/compat aea1ccfa92 1/6: Update documentation, test coverage is now 100%., ELPA Syncer, 2023/01/16
- [elpa] externals/compat 47953b014f 6/6: Add test for file-backup-file-names, ELPA Syncer, 2023/01/16
- [elpa] externals/compat 74ec2c1c56 5/6: Add test for make-nearby-temp-file, ELPA Syncer, 2023/01/16
- [elpa] externals/compat 041122b305 4/6: Update NEWS, ELPA Syncer, 2023/01/16
- [elpa] externals/compat b93ab4c0e0 2/6: Add test for executable-find,
ELPA Syncer <=
- [elpa] externals/compat 394028541e 3/6: Add test for exec-path, ELPA Syncer, 2023/01/16