branch: externals/hyperbole commit 8ab9a3b7bb04647b5a6bee8227fd2b5b50348988 Author: Bob Weiner <r...@gnu.org> Commit: Bob Weiner <r...@gnu.org>
Fix demo-org-hide-header-test with save-excursion --- ChangeLog | 4 ++++ test/demo-tests.el | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a20c653..a8398c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2021-05-09 Bob Weiner <r...@gnu.org> +* test/demo-tests.el (demo-org-hide-header-test): Fix, add + save-excursion around action-key call since somehow the + ert test runner changes the current buffer to its stats + buffer after this call, then the final should test fails. * hsys-org.el (hsys-org-radio-target-at-p, hsys-org-radio-target-link-at-p): Fix to return def or target region. diff --git a/test/demo-tests.el b/test/demo-tests.el index 475fa6c..eb4d671 100644 --- a/test/demo-tests.el +++ b/test/demo-tests.el @@ -239,18 +239,16 @@ ;; org (ert-deftest demo-org-hide-header-test () - "Hide org mode header. -Bug: Should work with action-key but does not. Works with org mode's hide function." - :expected-result :failed + "Hide org mode header." (with-temp-buffer (org-mode) (insert "* 1\n** 2\n*** 3\n") (goto-char 1) (should (not (org-check-for-hidden 'headlines))) - (action-key) + (save-excursion + (action-key)) ;;; (org-hide-entry) - (should (org-check-for-hidden 'headlines)) - )) + (should (org-check-for-hidden 'headlines)))) ;; Manifest (ert-deftest demo-manifest-test ()