branch: externals/hyperbole commit b18d7363a444261f9a511528bda95c3896067acc Author: Mats Lidell <mats.lid...@lidells.se> Commit: Mats Lidell <mats.lid...@lidells.se>
Add test for hui--menu-read-from-minibuffer Verify string replacement for selected value works. --- ChangeLog | 6 ++++++ test/MANIFEST | 1 + test/hui-mini-tests.el | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/ChangeLog b/ChangeLog index feb0d43421..67236e2610 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2025-01-30 Mats Lidell <ma...@gnu.org> +* test/hui-mini-tests.el (hui--menu-read-from-minibuffer): Unit test. + +* test/MANIFEST: Added hui-mini-tests.el. + +* test/hui-mini-tests.el: New file. Test for hui-mini. + * hui-mini.el (hui:menu-read-from-minibuffer): Use replace-regexp-in-string for compatibility with Emacs 27.2. diff --git a/test/MANIFEST b/test/MANIFEST index 31fd3f4f3c..00dbe43c1e 100644 --- a/test/MANIFEST +++ b/test/MANIFEST @@ -12,6 +12,7 @@ hmouse-info-tests.el - hmouse-info unit tests hpath-tests.el - unit tests for hpath hsettings-test.el - unit tests for hsettings hsys-org-tests.el - hsys-org tests +hui-mini-tests.el - hui-mini tests hui-register-tests.el - test for hui-register hui-select-tests.el - hui-select tests hui-tests.el - tests for hui.el Hyperbole UI diff --git a/test/hui-mini-tests.el b/test/hui-mini-tests.el new file mode 100644 index 0000000000..6bd0230ea5 --- /dev/null +++ b/test/hui-mini-tests.el @@ -0,0 +1,36 @@ +;;; hui-mini-tests.el --- Unit test for hui-mini -*- lexical-binding: t; -*- +;; +;; Author: Mats Lidell +;; +;; Orig-Date: 30-Jan-25 at 22:39:37 +;; Last-Mod: 30-Jan-25 at 23:28:18 by Mats Lidell +;; +;; SPDX-License-Identifier: GPL-3.0-or-later +;; +;; Copyright (C) 2025 Free Software Foundation, Inc. +;; See the "HY-COPY" file for license information. +;; +;; This file is part of GNU Hyperbole. + +;;; Commentary: +;; + +;;; Code: + +(require 'hui-mini) +(require 'ert) +(require 'el-mock) + +(ert-deftest hui--menu-read-from-minibuffer () + "Verify prompt shows proper active selection." + (defvar menu-string) + (dolist (v '((nil "None") + (:buttons "Hyperbole-Buttons-Only") + (t "All-Hyperbole-Contexts"))) + (let ((hsys-org-enable-smart-keys (car v)) + (menu-string (cadr v))) + (mocklet (((read-from-minibuffer "" (format "Org M-RET ==%s==" menu-string) hui:menu-mode-map nil t nil nil) => t)) + (should (hui:menu-read-from-minibuffer "" (format "Org M-RET %s" menu-string) hui:menu-mode-map nil t)))))) + +(provide 'hui-mini-tests) +;;; hui-mini-tests.el ends here