Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
2026-02-16 Mats Lidell <matsl@gnu.org>

* test/demo-tests.el:
* test/hmouse-drv-tests.el:
* test/hui-select-tests.el:
* test/hui-tests.el:
* test/hyrolo-tests.el:
* test/kotl-mode-tests.el: Activate skipped test that can run in batch mode.
* In addition to activating the tests some use of
hy-test-helpers:consume-input-events has been removed where it is not
needed.
* A few tests were blocked by checking quoted strings where the quotes
differ between batch and interactive. They have been modified to not verify
the part of the message that contains the quotes.

2026-02-15 Mats Lidell <matsl@gnu.org>

* hywiki.el (hywiki--org-link-html-format): Use
Expand Down
25 changes: 0 additions & 25 deletions test/demo-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@

;; Smart scrolling
(ert-deftest demo-smart-scrolling-proportional-test ()
(skip-unless (not noninteractive))
(unwind-protect
(let ((enable-local-variables nil))
(hypb:display-file-with-logo "DEMO")
Expand Down Expand Up @@ -148,12 +147,10 @@

;; HyRolo
(ert-deftest demo-hyrolo-test ()
(skip-unless (not noninteractive))
(unwind-protect
(with-temp-buffer
(load (expand-file-name "hyrolo-demo.el" hyperb:dir))
(should (hact 'kbd-key "C-x 4 r work RET"))
(hy-test-helpers:consume-input-events)
(should (string= (buffer-name) hyrolo-display-buffer))
(should (search-forward "Dunn, John")))
(hyrolo-demo-quit)))
Expand Down Expand Up @@ -414,7 +411,6 @@
(hy-test-helpers:kill-buffer "DEMO")))

(ert-deftest demo-factorial-ebutton-test ()
(skip-unless (not noninteractive))
(unwind-protect
(let ((enable-local-variables nil))
(hypb:display-file-with-logo "DEMO")
Expand Down Expand Up @@ -508,66 +504,55 @@

(ert-deftest fast-demo-key-series-dired-other-window ()
"Action key on `dired-other-window' brings up Dired in the other window."
(skip-unless (not noninteractive))
(with-temp-buffer
(insert "{M-x dired-other-window RET ${hyperb:dir}/*.el RET}")
(goto-char 5)
(action-key)
(hy-test-helpers:consume-input-events)
(should (equal 'dired-mode major-mode))
(should (equal hyperb:dir (expand-file-name default-directory)))))

(ert-deftest fast-demo-key-series-window-grid-22 ()
"Action key on window grid key series creates a grid."
(skip-unless (not noninteractive))
(with-temp-buffer
(insert "{C-c @ 22 RET}")
(goto-char 3)
(action-key)
(hy-test-helpers:consume-input-events)
(should (= 4 (length (window-list))))))

(ert-deftest fast-demo-key-series-kotl-files ()
"Action key brings up kotl files in a grid.
Note: Depends on key series in FAST-DEMO and how many files in
hyberbole folder that starts with kotl."
(skip-unless (not noninteractive))
(unwind-protect
(let ((enable-local-variables nil))
(hypb:display-file-with-logo "FAST-DEMO")
(goto-char (point-min))
(search-forward "{C--1 C-c @")
(action-key)
(hy-test-helpers:consume-input-events)
(should (= 4 (length (window-list)))))
(hy-test-helpers:kill-buffer "FAST-DEMO")))

(ert-deftest fast-demo-key-series-emacs-lisp-mode ()
"Action key brings up `emacs-lisp-mode' files in a grid.
Note: Relies on that empty windows are created when there are not
enough files with matching mode loaded."
(skip-unless (not noninteractive))
(with-temp-buffer
(insert "{C-u 0 C-c @ emacs-lisp-mode RET 33 RET}")
(goto-char 3)
(action-key)
(hy-test-helpers:consume-input-events)
(should (= 9 (length (window-list))))))

(ert-deftest fast-demo-key-series-hyperbole-dir ()
"Action key on hyperb:dir brings up hyperbole folder."
(skip-unless (not noninteractive))
(with-temp-buffer
(insert "{C-x 4 d ${hyperb:dir} RET}")
(goto-char 5)
(action-key)
(hy-test-helpers:consume-input-events)
(should (equal 'dired-mode major-mode))
(should (equal hyperb:dir (expand-file-name default-directory)))))

(ert-deftest fast-demo-key-series-keep-lines-ext ()
"Action key opens Ibuffer and keep lines with extension."
(skip-unless (not noninteractive))
(let ((buff "*Ibuffer*")
(old (global-key-binding (kbd "C-x C-b")))
(tmp (make-temp-file "hypb" nil ".hypb-test")))
Expand All @@ -578,7 +563,6 @@ enough files with matching mode loaded."
(insert "{C-x C-b C-x C-q M-x keep-lines RET .hypb-test$ RET C-x C-q}")
(goto-char 5)
(action-key)
(hy-test-helpers:consume-input-events)
(with-current-buffer buff
(should (looking-at-p (concat ".*" tmp)))))
(hy-test-helpers:kill-buffer buff)
Expand All @@ -588,7 +572,6 @@ enough files with matching mode loaded."

(ert-deftest fast-demo-key-series-keep-lines-slash ()
"Action key opens Ibuffer and keep lines that contains a slash."
(skip-unless (not noninteractive))
(let ((buff "*Ibuffer*")
(old (global-key-binding (kbd "C-x C-b")))
(dir (dired hyperb:dir)))
Expand All @@ -598,7 +581,6 @@ enough files with matching mode loaded."
(insert "{C-x C-b C-x C-q M-x keep-lines RET [\\/]$ RET C-x C-q}")
(goto-char 5)
(action-key)
(hy-test-helpers:consume-input-events)
(with-current-buffer buff
(should (looking-at-p (concat ".*[\\/]")))))
(hy-test-helpers:kill-buffer buff)
Expand All @@ -617,7 +599,6 @@ enough files with matching mode loaded."
(insert "{C-x C-b / RET dired-mode RET}")
(goto-char 5)
(action-key)
(hy-test-helpers:consume-input-events)
(with-current-buffer buff
(should (looking-at-p (concat ".*Dired by name")))))
(hy-test-helpers:kill-buffer buff)
Expand All @@ -637,7 +618,6 @@ enough files with matching mode loaded."
(insert "{ M-x shell RET M-> (cd ${hyperb:dir} && echo && echo \"PWD=$(pwd)\") RET }")
(goto-char 5)
(action-key)
(hy-test-helpers:consume-input-events)
(with-current-buffer shell-buffer-name
(goto-char (point-max))
(accept-process-output (get-buffer-process shell-buffer-name) 1)
Expand All @@ -650,7 +630,6 @@ enough files with matching mode loaded."

(ert-deftest fast-demo-key-series-shell-grep ()
"Action key executes grep shell command."
(skip-unless (not noninteractive))
(let* ((shell-file-name (executable-find "sh"))
(shell-buffer-name "*shell*")
(existing-shell-flag (get-buffer-process shell-buffer-name)))
Expand All @@ -659,7 +638,6 @@ enough files with matching mode loaded."
(insert "{M-x shell RET M-> (export HYPERBOLE_DIR=${hyperb:dir} && cd $HYPERBOLE_DIR && grep -n gbut:label-list *.el) RET}")
(goto-char 5)
(action-key)
(hy-test-helpers:consume-input-events)
(with-current-buffer shell-buffer-name
(with-timeout (5 (ert-fail "Test timed out"))
(while (not (string-match-p "\n.*\\.el:[0-9]+:.*defun.*gbut:label-list ()" (buffer-substring-no-properties (point-min) (point-max))))
Expand Down Expand Up @@ -707,7 +685,6 @@ enough files with matching mode loaded."
(goto-char 5)
(view-mode)
(action-key)
(hy-test-helpers:consume-input-events)
(with-current-buffer shell-buffer-name
(goto-char (point-max))
(accept-process-output (get-buffer-process shell-buffer-name) 1)
Expand All @@ -720,7 +697,6 @@ enough files with matching mode loaded."

(ert-deftest fast-demo-key-series-shell-grep-view-mode ()
"Action key executes grep shell command from buffer in `view-mode`."
(skip-unless (not noninteractive))
(let* ((shell-file-name (executable-find "sh"))
(shell-buffer-name "*shell*")
(existing-shell-flag (get-buffer-process shell-buffer-name)))
Expand All @@ -730,7 +706,6 @@ enough files with matching mode loaded."
(goto-char 5)
(view-mode)
(action-key)
(hy-test-helpers:consume-input-events)
(with-current-buffer shell-buffer-name
(with-timeout (5 (ert-fail "Test timed out"))
(while (not (string-match-p "\n.*\\.el:[0-9]+:.*defun.*gbut:label-list ()"
Expand Down
2 changes: 0 additions & 2 deletions test/hmouse-drv-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
(ibtype:delete 'ibtypes::defal-url)))

(ert-deftest hbut-defal-key-sequence ()
(skip-unless (not noninteractive))
(defal defal-key "{C-h v \\1 RET}")
(unwind-protect
(with-temp-buffer
Expand Down Expand Up @@ -137,7 +136,6 @@
(ibtype:delete 'ibtypes::defil-url)))

(ert-deftest hbut-defil-key-sequence ()
(skip-unless (not noninteractive))
(defil defil-key "<<<" ">>>" ".*" "{C-h v \\& RET}")
(unwind-protect
(with-temp-buffer
Expand Down
6 changes: 2 additions & 4 deletions test/hui-select-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@

(ert-deftest hui-select--thing ()
"`hui-select-thing' selects bigger sections of text when called repeatedly."
(skip-unless (not noninteractive))
(hui-select-reset)
(with-temp-buffer
(insert "Buffer\n\nParagraph\nline. One word.")
Expand Down Expand Up @@ -120,12 +119,11 @@
;; error
(ert-with-message-capture cap
(should-not (hui-select-thing))
(hy-test-helpers:should-last-message "(hui-select-boundaries): ‘buffer’ is the largest selectable region" cap))))
(hy-test-helpers:should-last-message "the largest selectable region" cap))))

(ert-deftest hui-select--thing-interactive-prints-type-of-match ()
"`hui-select-thing' selects bigger sections of text when called repeatedly.
Verifies right type of match is printed when `hui-select-display-type' is set to t."
(skip-unless (not noninteractive))
(let ((hui-select-display-type t))
(hui-select-reset)
(with-temp-buffer
Expand Down Expand Up @@ -167,7 +165,7 @@ Verifies right type of match is printed when `hui-select-display-type' is set to

(ert-with-message-capture cap
(should-not (call-interactively 'hui-select-thing))
(hy-test-helpers:should-last-message "(hui-select-boundaries): ‘buffer’ is the largest selectable region" cap)))))
(hy-test-helpers:should-last-message "the largest selectable region" cap)))))

(provide 'hui-select-tests)
;;; hui-select-tests.el ends here
4 changes: 0 additions & 4 deletions test/hui-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ of the defun."

(ert-deftest hui--copy-to-register--yank-in-same-kotl ()
"Yank klink in register into same kotl file."
(skip-unless (not noninteractive))
(let ((kotl-file (make-temp-file "hypb" nil ".kotl")))
(unwind-protect
(progn
Expand All @@ -541,7 +540,6 @@ of the defun."

(ert-deftest hui--copy-to-register--yank-in-other-kotl ()
"Yank klink in register into other kotl file."
(skip-unless (not noninteractive))
(let ((kotl-file (make-temp-file "hypb" nil ".kotl"))
(other-file (make-temp-file "hypb" nil ".kotl")))
(unwind-protect
Expand All @@ -567,7 +565,6 @@ of the defun."

(ert-deftest hui--copy-to-register--yank-in-other-file ()
"Yank klink in regiuster into other file."
(skip-unless (not noninteractive))
(let ((kotl-file (make-temp-file "hypb" nil ".kotl"))
(other-file (make-temp-file "hypb" nil ".txt")))
(unwind-protect
Expand All @@ -592,7 +589,6 @@ of the defun."

(ert-deftest hui--copy-to-register--yank-in-other-file-other-dir ()
"Yank klink in register into other file in other dir."
(skip-unless (not noninteractive))
(let* ((kotl-file (make-temp-file "hypb" nil ".kotl"))
(other-dir (make-temp-file "hypb" t))
(other-file (expand-file-name "other-file" other-dir)))
Expand Down
Loading