branch: externals/hyperbole commit 1a2938215a418f16d06d2bc596935eb1b4d19244 Author: bw <r...@gnu.org> Commit: bw <r...@gnu.org>
hywiki-create-page-and-display - Del ERT non-prompted referent code --- ChangeLog | 3 +++ hywiki.el | 7 ++----- test/hywiki-tests.el | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0dcf424893..9a3f8d47c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2025-08-17 Bob Weiner <r...@gnu.org> +* hywiki.el (hywiki-create-page-and-display): Remove non-prompted referent handling + when running an ERT test. + * test/hywiki-tests.el (hywiki-tests--hywiki-create-page--adds-no-wiki-word-fails): 'hywikig-add-page' should return nil so no removed the unneeded 'cdr' call. (hywiki-tests--a-wikiword-in-hywiki-directory): Rename diff --git a/hywiki.el b/hywiki.el index 342c855831..5c7c5bdd9d 100644 --- a/hywiki.el +++ b/hywiki.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 21-Apr-24 at 22:41:13 -;; Last-Mod: 16-Aug-25 at 23:54:09 by Bob Weiner +;; Last-Mod: 17-Aug-25 at 22:55:10 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -1411,10 +1411,7 @@ Use `hywiki-get-referent' to determine whether a HyWiki page exists." (called-interactively-p 'interactive)) (setq prompt-flag t)) (let* ((normalized-word (hywiki-get-singular-wikiword wikiword)) - (referent - (if (bound-and-true-p ert--running-tests) - (hywiki-get-referent wikiword) - (hywiki-find-referent wikiword prompt-flag)))) + (referent (hywiki-find-referent wikiword prompt-flag))) (cond (referent) ((and (null referent) (hywiki-word-is-p normalized-word)) (when (hywiki-add-page normalized-word) diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el index b925e0a1ff..23c4157e71 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: 17-Aug-25 at 23:27:18 by Mats Lidell +;; Last-Mod: 17-Aug-25 at 23:35:38 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -1268,6 +1268,7 @@ named WikiReferent with a non-page referent type." (save-buffer) (goto-char 4) (should (hact 'kbd-key "C-u C-h hhck {C-e SPC ABC} RET")) + (hy-test-helpers:consume-input-events) (should (equal (cons 'key-series "C-e SPC {ABC}") (hywiki-get-referent "WikiWord"))) (should (string-equal "Wiki{C-e ABC}Referent" @@ -1319,9 +1320,8 @@ named WikiReferent with a non-page referent type." ;; (skip-unless (not (version< emacs-version "29"))) ;; Fails on 28!? (hywiki-tests--referent-test (cons 'find #'hywiki-word-grep) - (hy-test-helpers:ert-simulate-keys - "C-u C-h hhc WikiReferent RET f hywikiword RET" - (hy-test-helpers:consume-input-events)))) + (should (hact 'kbd-key "C-u C-h hhc WikiReferent RET f hywikiword RET")) + (hy-test-helpers:consume-input-events))) ;; Global-button (ert-deftest hywiki-tests--save-referent-global-button ()