emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole 372d32e 2/2: Merge branch 'master' of hyperbo


From: ELPA Syncer
Subject: [elpa] externals/hyperbole 372d32e 2/2: Merge branch 'master' of hyperbole
Date: Sun, 12 Dec 2021 11:57:27 -0500 (EST)

branch: externals/hyperbole
commit 372d32e96b4d105d58d974fa32115c87ea9af2c0
Merge: 4ea5696 288cb87
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>

    Merge branch 'master' of hyperbole
---
 ChangeLog           |  6 ++++++
 test/hpath-tests.el | 25 +++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 17b15de..ce7469b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,12 @@
 
 * hyperbole.el (hkey-initialize): Add missing C-c prefix binding for 
hyperbole-mode-map.
 
+2021-12-11  Mats Lidell  <matsl@gnu.org>
+
+* test/hpath-tests.el (hypb-run-shell-test-command): Test helper for
+    running shell commands.
+    (hpath:prepend-ls-directory-test): Test for "ls R" listing.
+
 2021-12-05  Bob Weiner  <rsw@gnu.org>
 
 * hyrolo.el (hyrolo-next-match): Handle case when no prior regexp search.
diff --git a/test/hpath-tests.el b/test/hpath-tests.el
index d9e1651..24defb1 100644
--- a/test/hpath-tests.el
+++ b/test/hpath-tests.el
@@ -18,6 +18,11 @@
 (require 'ert)
 (require 'hpath)
 
+(load (expand-file-name "hy-test-helpers"
+                        (file-name-directory (or load-file-name
+                                                 default-directory))))
+(declare-function hy-test-helpers:action-key-should-call-hpath:find 
"hy-test-helpers")
+
 (ert-deftest hpath:find-report-lisp-variable-path-name-when-not-exists ()
   "Test that hpath:find expands and returns filename when it is non-existent."
   (condition-case err
@@ -103,5 +108,25 @@
          (should (string= (hpath:substitute-value 
"${UNDEFINED_IS_NOT_SUBSTITUTED}") "${UNDEFINED_IS_NOT_SUBSTITUTED}"))
          ))
 
+(defun hypb-run-shell-test-command (command buffer)
+  "Run a shell COMMAND with output to BUFFER and select it."
+  (shell-command command buffer nil)
+  (switch-to-buffer buffer)
+  (shell-mode))
+
+(ert-deftest hpath:prepend-ls-directory-test ()
+  "Find file in ls -R listing."
+  (let ((shell-buffer "*hypb-test-shell-buffer*"))
+    (unwind-protect
+        (let ((explicit-shell-file-name "/usr/bin/sh")
+              (default-directory hyperb:dir))
+          (hypb-run-shell-test-command "ls -R" shell-buffer)
+          (dolist (file '("COPYING" "man/version.texi" "man/hkey-help.txt" 
"man/im/demo.png"))
+            (goto-char (point-min))
+            (should (search-forward (car (last (split-string file "/"))) nil 
t))
+            (backward-char 5)
+            (hy-test-helpers:action-key-should-call-hpath:find 
(expand-file-name file hyperb:dir))))
+      (kill-buffer shell-buffer))))
+
 (provide 'hpath-tests)
 ;;; hpath-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]