branch: externals/hyperbole commit 1f45b45af97ae70131cf79113558d3803ecf56c6 Author: Mats Lidell <mats.lid...@lidells.se> Commit: Mats Lidell <mats.lid...@lidells.se>
Add hyrolo-get-file-list tests --- ChangeLog | 5 +++++ test/hyrolo-tests.el | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 650a09db5b..4969506ca4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2023-01-02 Mats Lidell <ma...@gnu.org> + +* test/hyrolo-tests.el (hyrolo-tests--get-file-list-change) + (hyrolo-tests--get-file-list-wrong-suffice): Add hyrolo tests. + 2024-01-02 Mats Lidell <ma...@gnu.org> * test/hypb-ert-tests.el (hypb-ert-tests--def-at-p) diff --git a/test/hyrolo-tests.el b/test/hyrolo-tests.el index 68dac7f64f..06b18d9e55 100644 --- a/test/hyrolo-tests.el +++ b/test/hyrolo-tests.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell <ma...@gnu.org> ;; ;; Orig-Date: 19-Jun-21 at 22:42:00 -;; Last-Mod: 30-Dec-23 at 23:22:54 by Bob Weiner +;; Last-Mod: 31-Dec-23 at 16:10:00 by Mats Lidell ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -24,6 +24,7 @@ (require 'hyrolo-demo) (require 'hy-test-helpers "test/hy-test-helpers") (require 'hib-kbd) +(require 'kotl-mode) (require 'with-simulated-input) (declare-function hy-test-helpers:consume-input-events "hy-test-helpers") @@ -449,5 +450,21 @@ Match a string in the second cell." (kill-buffer hyrolo-display-buffer) (delete-directory temporary-file-directory)))) +(ert-deftest hyrolo-tests--get-file-list-change () + "Verify a change to hyrolo-file-list is noticed by hyrolo-get-file-list." + (let* ((tmp-file (make-temp-file "hypb" nil ".org")) + (hyrolo-file-list (list tmp-file))) + (unwind-protect + (let ((hl (hyrolo-get-file-list))) + (should (= 1 (length hl))) + (should (string= (car hl) tmp-file))) + (hy-delete-file-and-buffer tmp-file)))) + +(ert-deftest hyrolo-tests--get-file-list-wrong-suffice () + "Verify files need to have the proper suffix in hyrolo-file-list." + (should-error + (let ((hyrolo-file-list (list "file-no-proper-suffix"))) + ()))) + (provide 'hyrolo-tests) ;;; hyrolo-tests.el ends here