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
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2026-04-10 Mats Lidell <matsl@gnu.org>

* test/hyrolo-tests.el (hyrolo-tests--fgrep-move-test): Add more tests for
movement when a section is hidden.

2026-04-08 Bob Weiner <rsw@gnu.org>

* test/hyrolo-tests.el (hyrolo-tests--fgrep-move-test): Move tests more
Expand Down
32 changes: 31 additions & 1 deletion test/hyrolo-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ Match a string in the second cell."

(ert-deftest hyrolo-tests--fgrep-move-test ()
"Verify different move commands after `hyrolo-fgrep'."
:expected-result :failed
(let* ((kotl-file1 (hyrolo-tests--gen-kotl-outline "heading" "foo bar" 1))
(kotl-file2 (hyrolo-tests--gen-kotl-outline "heading" "foo bar" 1))
(hyrolo-file-list (list kotl-file1 kotl-file2))
Expand All @@ -483,8 +484,37 @@ Match a string in the second cell."
(execute-kbd-macro (kbd "n"))
(should (eobp)))

(ert-info ("With hidden first header move up using ?p")
(execute-kbd-macro (kbd "p"))
(should (looking-at-p h1a_str))
(execute-kbd-macro (kbd "p"))
(should (looking-at-p h1_str))
(execute-kbd-macro (kbd "p"))
(should (looking-at-p "==="))
(execute-kbd-macro (kbd "p"))
(should (looking-at-p "==="))
(should (bobp)))

(ert-info ("With hidden first header move down using ?f")
(should (looking-at-p "==="))
(execute-kbd-macro (kbd "f"))
(should (looking-at-p "==="))
(execute-kbd-macro (kbd "f"))
(should (looking-at-p h1_str))
(let ((err (should-error (execute-kbd-macro (kbd "f")))))
(should (string-match-p "No following same-level heading/header" (cadr err)))))

(ert-info ("With hidden first header move up using ?b")
(execute-kbd-macro (kbd "b"))
(should (looking-at-p "==="))
(execute-kbd-macro (kbd "b"))
(should (looking-at-p "==="))
(should (bobp))
(let ((err (should-error (execute-kbd-macro (kbd "b")))))
(should-not (equal '(void-function nil) err)))) ;FIXME: No error message but void-function!?

(outline-show-all)
(goto-char (point-min))

(ert-info ("Move down using ?n")
(should (looking-at-p "==="))
(execute-kbd-macro (kbd "n"))
Expand Down