branch: externals/hyperbole
commit 039fe8d0df54c6d38d33578c96b62a6deb7c0a2e
Author: Mats Lidell <[email protected]>
Commit: GitHub <[email protected]>

    Make one more test work in batch (#886)
    
    * test/hargs-tests.el (hargs-get-verify-extension-characters): Make test run
        in batch.
---
 ChangeLog           |  3 +++
 test/hargs-tests.el | 34 +++++++++++++++-------------------
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0c9ff7eeef..a4b58b3c65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2026-03-04  Mats Lidell  <[email protected]>
 
+* test/hargs-tests.el (hargs-get-verify-extension-characters): Make test run
+    in batch.
+
 * Makefile (docker): Remove all elc files in the docker container.
 
 2026-03-03  Mats Lidell  <[email protected]>
diff --git a/test/hargs-tests.el b/test/hargs-tests.el
index 41b93586c9..575aa557c9 100644
--- a/test/hargs-tests.el
+++ b/test/hargs-tests.el
@@ -24,29 +24,25 @@
 (require 'hy-test-helpers "test/hy-test-helpers")
 
 (ert-deftest hargs-get-verify-extension-characters ()
-  "Verify hyperbole extension characters are indentified."
-  (skip-unless (not noninteractive))
+  "Verify hyperbole extension character are identified."
+  (hy-test-helpers:ert-simulate-keys "xyz\r"
+    (should (string= (hargs:get "+L: ") "xyz")))
+  (hy-test-helpers:ert-simulate-keys "xyz\r"
+    (should (string= (hargs:get "+V: ") "xyz")))
+  (hy-test-helpers:ert-simulate-keys "xyz\r"
+    (should (string= (hargs:get "+K: ") "xyz")))
+  (should-error (hargs:get "+A: ") :type 'error)
+  (let ((Info-current-file-completions '(("xyz"))))
+    (hy-test-helpers:ert-simulate-keys "xyz\r"
+      (should (string= (hargs:get "+I: ") "xyz"))))
+  (hy-test-helpers:ert-simulate-keys "(emacs)info\r"
+    (should (string= (hargs:get "+X: ") "(emacs)info")))
   (let ((file (make-temp-file "hypb")))
     (unwind-protect
-        (progn
-          (hy-test-helpers:ert-simulate-keys "xyz\r"
-            (should (string= (hargs:get "+I: ") "xyz")))
-          (hy-test-helpers:ert-simulate-keys "xyz\r"
-            (should (string= (hargs:get "+L: ") "xyz")))
-          (hy-test-helpers:ert-simulate-keys (concat "(\"xyz\" \"" file 
"\")\r")
-            (should (equal (hargs:get "+M: ") (list "xyz" file))))
-          (hy-test-helpers:ert-simulate-keys "xyz\r"
-            (should (string= (hargs:get "+V: ") "xyz")))
-          (hy-test-helpers:ert-simulate-keys "xyz\r"
-            (should (string= (hargs:get "+X: ") "(dir)xyz")))
-          (should-error (hargs:get "+A: ") :type 'error))
+        (hy-test-helpers:ert-simulate-keys (concat "(\"xyz\" \"" file "\")\r")
+          (should (equal (hargs:get "+M: ") (list "xyz" file))))
       (hy-delete-file-and-buffer file))))
 
-(ert-deftest hargs-get-verify-extension-characters-+K ()
-  "Verify hyperbole extension character +K is indentified."
-  (cl-letf (((symbol-function 'hargs:read) (lambda (_prompt &optional _a _b _c 
_d) "xyz")))
-    (should (string= (hargs:get "+K: ") "xyz"))))
-
 (ert-deftest hargs-tests--sexpression-p ()
   "Verify behavior of `hargs:sexpression-p'."
   (with-temp-buffer

Reply via email to