branch: externals/hyperbole commit 2648dd8708944c9eae56496d960f11744d64c5e5 Author: Mats Lidell <mats.lid...@lidells.se> Commit: GitHub <nore...@github.com>
add missing wikipage in test (#713) --- ChangeLog | 9 +++++++++ hywiki.el | 8 +++++--- test/hy-test-helpers.el | 10 +--------- test/hywiki-tests.el | 5 +++-- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index da0ed9e24f..4479cb8357 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2025-04-26 Mats Lidell <ma...@gnu.org> +* hywiki.el (hywiki-word-face-at-p): Add optional pos to enable reuse. + +* test/hy-test-helpers.el (hy-test-word-face-at-region): Simplify by + reusing hywiki-word-face-at-p. + +* test/hywiki-tests.el + (hywiki-tests--wikiword-step-check-verification-with-faces): Add + missing WikiWord, Hiho, required by the test. Enable the test for CI. + * test/hywiki-tests.el: * test/hui-tests.el: * test/hmouse-info-tests.el: diff --git a/hywiki.el b/hywiki.el index 4e72202125..8d91089d45 100644 --- a/hywiki.el +++ b/hywiki.el @@ -3173,9 +3173,11 @@ a HyWikiWord at point." (= (matching-paren (char-before (nth 1 range))) (char-after (nth 2 range)))))))) -(defun hywiki-word-face-at-p () - "Non-nil if but at point has `hywiki-word-face' property." - (hproperty:but-get (point) 'face hywiki-word-face)) +(defun hywiki-word-face-at-p (&optional pos) + "Non-nil if but at point or optional POS has `hywiki-word-face' property." + (unless pos + (setq pos (point))) + (hproperty:but-get pos 'face hywiki-word-face)) ;;;###autoload (defun hywiki-word-consult-grep (word) diff --git a/test/hy-test-helpers.el b/test/hy-test-helpers.el index f5eef8debc..13b6766cb9 100644 --- a/test/hy-test-helpers.el +++ b/test/hy-test-helpers.el @@ -127,20 +127,12 @@ and the default WORD-LENGTH is 4." (defvar hy-test-run-failing-flag nil "Non-nil means test cases that are known to fail will be tried.") -(defun hy-test-word-face-at-point (&optional pos) - "Non-nil if `hywiki--word-face' at POS." - (unless pos - (setq pos (point))) - (cl-dolist (ol (overlays-at pos) nil) - (if (equal (overlay-get ol 'face) 'hywiki--word-face) - (cl-return t)))) - (defun hy-test-word-face-at-region (beg end) "Non-nil if all chars in region [BEG, END] have `hywiki--word-face'." (interactive "r") (let (no-face) (while (and (< beg end) (not no-face)) - (unless (hy-test-word-face-at-point beg) + (unless (hywiki-word-face-at-p beg) (setq no-face t)) (setq beg (1+ beg))) (not no-face))) diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el index b5b44e9560..e582fc388f 100644 --- a/test/hywiki-tests.el +++ b/test/hywiki-tests.el @@ -1386,13 +1386,14 @@ resulting state at point is a WikiWord or not." "Run the step check to verify WikiWord is identified under change. Performs each operation from the step check and verifies if the resulting state at point is a WikiWord or not." - (skip-unless hy-test-run-failing-flag) + (skip-unless (not noninteractive)) (hywiki-tests--preserve-hywiki-mode (let* ((hywiki-directory (make-temp-file "hywiki" t)) (wikiHiHo (cdr (hywiki-add-page "HiHo"))) + (wikiHiho (cdr (hywiki-add-page "Hiho"))) (wikiHi (cdr (hywiki-add-page "Hi"))) (wikiHo (cdr (hywiki-add-page "Ho"))) - (wiki-page-list (list wikiHiHo wikiHi wikiHo)) + (wiki-page-list (list wikiHiHo wikiHiho wikiHi wikiHo)) (hywiki-tests--with-face-test t)) (unwind-protect (progn