branch: externals/hyperbole commit 6b93a58fc6ab277947cb3f1686872118dfc7a9ff Author: Mats Lidell <mats.lid...@lidells.se> Commit: GitHub <nore...@github.com>
Verify creating a file for WikiWord highlights WikiWord (#744) --- ChangeLog | 6 ++++++ test/hy-test-helpers.el | 3 ++- test/hywiki-tests.el | 21 ++++++++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 140361a83e..49c8096d08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2025-06-24 Mats Lidell <ma...@gnu.org> + +* test/hywiki-tests.el (hywiki-tests--create-wikiword-file-highlights-wikiword): + Verify creating a file for WikiWord highlights the instances of + WikiWord that already is present in other files. + 2025-06-22 Bob Weiner <r...@gnu.org> * hproperty.el (hproperty:but-get-first-in-region): Change from returning a list diff --git a/test/hy-test-helpers.el b/test/hy-test-helpers.el index 5d0b78819a..738e3aa34d 100644 --- a/test/hy-test-helpers.el +++ b/test/hy-test-helpers.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell <ma...@gnu.org> ;; ;; Orig-Date: 30-Jan-21 at 12:00:00 -;; Last-Mod: 1-Jun-25 at 23:22:27 by Mats Lidell +;; Last-Mod: 24-Jun-25 at 10:21:13 by Mats Lidell ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -20,6 +20,7 @@ (require 'ert) (require 'hmouse-drv) ; For `action-key' +(require 'hywiki) ; For `hywiki-word-face-at-p' (eval-when-compile (require 'cl-lib)) (defun hy-test-helpers:consume-input-events () diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el index c756427c13..56f4527bc0 100644 --- a/test/hywiki-tests.el +++ b/test/hywiki-tests.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell ;; ;; Orig-Date: 18-May-24 at 23:59:48 -;; Last-Mod: 22-Jun-25 at 22:32:29 by Bob Weiner +;; Last-Mod: 24-Jun-25 at 09:36:49 by Mats Lidell ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -1672,6 +1672,25 @@ Insert test in the middle of other text." (hy-delete-files-and-buffers (list wikiHi wikiHo)) (hy-delete-dir-and-buffer hywiki-directory))))) +(ert-deftest hywiki-tests--create-wikiword-file-highlights-wikiword () + "Verify creating a WikiWord-file highlights the WikiWord in another file." + (hywiki-tests--preserve-hywiki-mode + (let* ((hywiki-directory (make-temp-file "hywiki" t)) + (wikiHi (cdr (hywiki-add-page "Hi"))) + (hywiki-tests--with-face-test t) + wikiHo) + (unwind-protect + (progn + (hywiki-mode 1) + (with-current-buffer (find-file wikiHi) + (insert "Ho") + (save-buffer) + (setq wikiHo (cdr (hywiki-add-page "Ho"))) + (goto-char 2) + (hywiki-tests--verify-hywiki-word "Ho"))) + (hy-delete-files-and-buffers (list wikiHi wikiHo)) + (hy-delete-dir-and-buffer hywiki-directory))))) + (provide 'hywiki-tests) ;; This file can't be byte-compiled without the `el-mock' package