[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 288cb87: Add test for buttons in ls R listing
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 288cb87: Add test for buttons in ls R listing (#133) |
Date: |
Sat, 11 Dec 2021 17:57:28 -0500 (EST) |
branch: externals/hyperbole
commit 288cb87971cbd9344d854a18413e9c6fac3611b9
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: GitHub <noreply@github.com>
Add test for buttons in ls R listing (#133)
---
ChangeLog | 6 ++++++
test/hpath-tests.el | 25 +++++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index fe475ab..8f80a87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/hyperbole 288cb87: Add test for buttons in ls R listing (#133),
ELPA Syncer <=