branch: externals/hyperbole
commit 72aaf856939404939256de7c29b2379f31c291f7
Merge: c024330f5a1 c7dacd5545e
Author: bw <[email protected]>
Commit: bw <[email protected]>

    Merge branch 'master' into rsw
---
 ChangeLog            |  7 +++++++
 test/hywiki-tests.el | 27 ++++++++++++++++++++++-----
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9bff0d7fffb..5f54007b877 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,13 @@
                (hycontrol--frames-prompt-format, 
hycontrol--windows-prompt-format):
     Reformat for easier readability.
 
+2026-06-30  Mats Lidell  <[email protected]>
+
+* test/hywiki-tests.el (hywiki-display-hywiki-test): Add helper
+    display function.
+    (hywiki-tests--display-referent-type): Verify right display function
+    is called and hbut:current attributes are set.
+
 2026-06-30  Bob Weiner  <[email protected]>
 
 * FAST-DEMO: Add link to EmacsATX unscripted demo of Hyperbole.
diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el
index 797dfc109c4..4ca005d07d8 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:      4-Jul-26 at 20:07:04 by Bob Weiner
+;; Last-Mod:      6-Jul-26 at 21:29:42 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -2071,11 +2071,28 @@ expected result."
                       (list #'hywiki-tags-view t nil bn)))
         (should (= (line-number-at-pos) 3))))))
 
+(defun hywiki-display-hywiki-test (wikiword value)
+  "Test helper for display-referent-type."
+  (format "%s:%s" wikiword value))
+
 (ert-deftest hywiki-tests--display-referent-type ()
-  "Verify error case for `hywiki-display-referent-type'."
-  (with-temp-buffer
-    (let ((err (should-error (hywiki-display-referent-type "WikiWord" (cons 
'unknown-type 'value)) :type 'error)))
-      (should (string-match-p "No hywiki-display function for referent type 
.unknown-type." (cadr err))))))
+  "Verify `hywiki-display-referent-type'.
+See helper `hywiki-display-hywiki-test' above for verifying display call."
+  (hywiki-tests--preserve-hywiki-mode
+    (insert "WikiWord")
+    (goto-char 4)
+
+    (ert-info ("Error cases")
+      (let ((err (should-error (hywiki-display-referent-type "WikiWord" (cons 
"unknown-type" 'value)) :type 'error)))
+        (should (string-match-p "Referent type must be a symbol" (cadr err))))
+      (let ((err (should-error (hywiki-display-referent-type "WikiWord" (cons 
'unknown-type 'value)) :type 'error)))
+        (should (string-match-p "No hywiki-display function for referent type 
.unknown-type." (cadr err)))))
+
+    (ert-info ("Display hywiki-test with Value")
+      (hattr:clear 'hbut:current)
+      (should (string= "WikiWord:Value" (hywiki-display-referent-type 
"WikiWord" (cons 'hywiki-test 'Value))))
+      (should (string= "hywiki-test" (hattr:get 'hbut:current 'referent-type)))
+      (should (equal 'Value (hattr:get 'hbut:current 'referent-value))))))
 
 (ert-deftest hywiki-tests--create-referent ()
   "Verify `hywiki-create-referent'."

Reply via email to