emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole 9e959265cf: Add hmouse-info tests (#138)


From: ELPA Syncer
Subject: [elpa] externals/hyperbole 9e959265cf: Add hmouse-info tests (#138)
Date: Wed, 29 Dec 2021 11:57:32 -0500 (EST)

branch: externals/hyperbole
commit 9e959265cf1ef7a19e762c3698efd03281b5f7be
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: GitHub <noreply@github.com>

    Add hmouse-info tests (#138)
---
 ChangeLog                 |  6 ++++++
 test/hmouse-info-tests.el | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 04531e78d6..90860e449f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-12-29  Mats Lidell  <matsl@gnu.org>
+
+* test/hmouse-info-tests.el (hmouse-info-read-index-with-completion)
+(hmouse-info-build-completions-no-match)
+(hmouse-info-build-completions-multiple-matches): hmouse-info tests.
+
 2021-12-28  Mats Lidell  <matsl@gnu.org>
 
 * kotl/kotl-mode.el (kotl-mode:exchange-cells): Use cl-copy-list.
diff --git a/test/hmouse-info-tests.el b/test/hmouse-info-tests.el
new file mode 100644
index 0000000000..5cd602b468
--- /dev/null
+++ b/test/hmouse-info-tests.el
@@ -0,0 +1,47 @@
+;;; hmouse-info-tests.el --- hmouse-info unit tests         -*- 
lexical-binding: t; -*-
+
+;; Author: Mats Lidell <matsl@gnu.org>
+;;
+;; Orig-Date: 29-Dec-21 at 09:02:00
+;;
+;; Copyright (C) 2021  Free Software Foundation, Inc.
+;; See the "HY-COPY" file for license information.
+;;
+;; This file is part of GNU Hyperbole.
+
+;;; Commentary:
+
+;; See "../hmouse-info.el"
+
+;;; Code:
+
+(require 'ert)
+(require 'hmouse-info)
+(require 'with-simulated-input)
+
+(ert-deftest hmouse-info-read-index-with-completion ()
+  "Read a completion that completes."
+  (with-simulated-input "(emacs)regex TAB RET"
+    (should (string= "(emacs)regexp" (Info-read-index-item-name "Prompt: ")))))
+
+(ert-deftest hmouse-info-build-completions-no-match ()
+  "Build completions."
+  (unwind-protect
+      (progn
+        (info "(emacs)")
+        (setq Info-complete-menu-buffer (clone-buffer))
+        (should (eq '() (Info-build-menu-item-completions "nothinglikethis" 
nil t)))
+    (kill-buffer "*info*"))))
+
+(ert-deftest hmouse-info-build-completions-multiple-matches ()
+  "Build completions."
+  (unwind-protect
+      (progn
+        (info "(emacs)")
+        (setq Info-complete-menu-buffer (clone-buffer))
+        (dolist (m (Info-build-menu-item-completions "regexp" nil t))
+          (should (string-prefix-p "regexp" m t))))
+    (kill-buffer "*info*")))
+
+(provide 'hmouse-info-tests)
+;;; hmouse-info-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]