[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 798d0e8 1/6: Add path prefix tests (#71)
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 798d0e8 1/6: Add path prefix tests (#71) |
Date: |
Wed, 21 Apr 2021 00:57:08 -0400 (EDT) |
branch: externals/hyperbole
commit 798d0e88365d2fb02818dd06a66176a06f6fa0f4
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: GitHub <noreply@github.com>
Add path prefix tests (#71)
---
Changes | 8 ++++++++
test/hbut-tests.el | 26 ++++++++++++++++++++++++++
test/hpath-tests.el | 19 +++++++++++++++++++
3 files changed, 53 insertions(+)
diff --git a/Changes b/Changes
index 493eb07..40457d5 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,11 @@
+2021-04-20 Mats Lidell <matsl@gnu.org>
+
+* test/hpath-tests.el (hpath:find-exec-shell-cmd-test)
+ (hpath:find-exec-window-cmd-test): Path prefix tests.
+
+* test/hbut-tests.el (hbut-find-exec-shell-cmd-test)
+ (hbut-find-exec-window-cmd-test): Path prefix tests.
+
2021-04-19 Bob Weiner <rsw@gnu.org>
* hsys-org.el (hsys-org-link-at-p): Change to use org-link-bracket-re so match
diff --git a/test/hbut-tests.el b/test/hbut-tests.el
index 6260015..67eb735 100644
--- a/test/hbut-tests.el
+++ b/test/hbut-tests.el
@@ -457,6 +457,32 @@
(should (string= "*info*" (buffer-name))))
(kill-buffer "*info*")))
+;; exec-shell-cmd
+(ert-deftest hbut-find-exec-shell-cmd-test ()
+ "Path prefix ! will run pathname as a non windowed program."
+ (with-temp-buffer
+ (insert "\"!/bin/ls\"")
+ (goto-char 2)
+ (let ((was-called nil))
+ (cl-letf (((symbol-function 'actypes::exec-shell-cmd)
+ (lambda (filename)
+ (setq was-called (should (string= "/bin/ls" filename))))))
+ (action-key)
+ (should was-called)))))
+
+;; exec-window-cmd
+(ert-deftest hbut-find-exec-window-cmd-test ()
+ "Path prefix & will run pathname as a windowed program."
+ (with-temp-buffer
+ (insert "\"&/bin/ls\"")
+ (goto-char 2)
+ (let ((was-called nil))
+ (cl-letf (((symbol-function 'actypes::exec-window-cmd)
+ (lambda (filename)
+ (setq was-called (should (string= "/bin/ls" filename))))))
+ (action-key)
+ (should was-called)))))
+
;; This file can't be byte-compiled without the `el-mock' package (because of
;; the use of the `with-mock' macro), which is not a dependency of Hyperbole.
;; Local Variables:
diff --git a/test/hpath-tests.el b/test/hpath-tests.el
index 2ab557d..b372640 100644
--- a/test/hpath-tests.el
+++ b/test/hpath-tests.el
@@ -38,5 +38,24 @@
(goto-char 7)
(should (not (hpath:at-p)))))
+(ert-deftest hpath:find-exec-shell-cmd-test ()
+ "Path prefix ! will run pathname as a non windowed program."
+ (let ((was-called nil))
+ (cl-letf (((symbol-function 'actypes::exec-shell-cmd)
+ (lambda (filename)
+ (setq was-called (should (string= "/bin/ls" filename))))))
+ (hpath:find "!/bin/ls")
+ (should was-called))))
+
+(ert-deftest hpath:find-exec-window-cmd-test ()
+ "Path prefix & will run pathname as a windowed program."
+ (let ((was-called nil))
+ (cl-letf (((symbol-function 'actypes::exec-window-cmd)
+ (lambda (filename)
+ (setq was-called (should (string= "/bin/ls" filename))))))
+ (hpath:find "&/bin/ls")
+ (should was-called))))
+
+
(provide 'hpath-tests)
;;; hpath-tests.el ends here
- [elpa] externals/hyperbole updated (f55679b -> b53bfbe), ELPA Syncer, 2021/04/21
- [elpa] externals/hyperbole 6e40862 2/6: +* kotl-autoloads.el: Remove reference to unreleased kexport-menu.el, ELPA Syncer, 2021/04/21
- [elpa] externals/hyperbole 6d08d5e 3/6: Add tests and all-tests testing target aliases, ELPA Syncer, 2021/04/21
- [elpa] externals/hyperbole 798d0e8 1/6: Add path prefix tests (#71),
ELPA Syncer <=
- [elpa] externals/hyperbole e0eaa85 4/6: Make smart-magit-mode trigger ahead of hbuts for consistency, ELPA Syncer, 2021/04/21
- [elpa] externals/hyperbole ce82b18 5/6: Fix bug#47909: Update regexes and hyrolo-grep calls so doc-ids work, ELPA Syncer, 2021/04/21
- [elpa] externals/hyperbole b53bfbe 6/6: hactypes.el - Fix Windows-compatibility when executing shell actions, ELPA Syncer, 2021/04/21