Skip to content

Commit ba3fbc7

Browse files
authored
Add more hyrolo movement tests (#935)
* test/hyrolo-tests.el (hyrolo-tests--fgrep-move-test): Add more tests for movement when a section is hidden.
1 parent 6316cf5 commit ba3fbc7

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2026-04-10 Mats Lidell <matsl@gnu.org>
2+
3+
* test/hyrolo-tests.el (hyrolo-tests--fgrep-move-test): Add more tests for
4+
movement when a section is hidden.
5+
16
2026-04-08 Bob Weiner <rsw@gnu.org>
27

38
* test/hyrolo-tests.el (hyrolo-tests--fgrep-move-test): Move tests more

test/hyrolo-tests.el

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ Match a string in the second cell."
461461

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

487+
(ert-info ("With hidden first header move up using ?p")
488+
(execute-kbd-macro (kbd "p"))
489+
(should (looking-at-p h1a_str))
490+
(execute-kbd-macro (kbd "p"))
491+
(should (looking-at-p h1_str))
492+
(execute-kbd-macro (kbd "p"))
493+
(should (looking-at-p "==="))
494+
(execute-kbd-macro (kbd "p"))
495+
(should (looking-at-p "==="))
496+
(should (bobp)))
497+
498+
(ert-info ("With hidden first header move down using ?f")
499+
(should (looking-at-p "==="))
500+
(execute-kbd-macro (kbd "f"))
501+
(should (looking-at-p "==="))
502+
(execute-kbd-macro (kbd "f"))
503+
(should (looking-at-p h1_str))
504+
(let ((err (should-error (execute-kbd-macro (kbd "f")))))
505+
(should (string-match-p "No following same-level heading/header" (cadr err)))))
506+
507+
(ert-info ("With hidden first header move up using ?b")
508+
(execute-kbd-macro (kbd "b"))
509+
(should (looking-at-p "==="))
510+
(execute-kbd-macro (kbd "b"))
511+
(should (looking-at-p "==="))
512+
(should (bobp))
513+
(let ((err (should-error (execute-kbd-macro (kbd "b")))))
514+
(should-not (equal '(void-function nil) err)))) ;FIXME: No error message but void-function!?
515+
486516
(outline-show-all)
487-
(goto-char (point-min))
517+
488518
(ert-info ("Move down using ?n")
489519
(should (looking-at-p "==="))
490520
(execute-kbd-macro (kbd "n"))

0 commit comments

Comments
 (0)