[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 97f4e12386 023/143: hui--link-possible-types
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 97f4e12386 023/143: hui--link-possible-types - ensure only 1 specific type per test |
Date: |
Mon, 19 Feb 2024 15:58:48 -0500 (EST) |
branch: externals/hyperbole
commit 97f4e12386f170a072ea82316cacea203abe0c7f
Author: bw <rsw@gnu.org>
Commit: bw <rsw@gnu.org>
hui--link-possible-types - ensure only 1 specific type per test
---
ChangeLog | 6 ++++++
test/hui-tests.el | 40 ++++++++++++++++++++--------------------
test/hy-test-helpers.el | 9 ++++++++-
3 files changed, 34 insertions(+), 21 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e4ced2a29c..3d792debff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-12-26 Bob Weiner <rsw@gnu.org>
+
+* test/hy-test-helpers.el (hy-test-helpers:ensure-link-possible-type): Add.
+ test/hui-tests.el (hui--link-possible-types): Use above function to ensure
+ 'hui:link-possible-types' returns one given type only for each test herein.
+
2023-12-26 Mats Lidell <matsl@gnu.org>
* test/hy-test-helpers.el (hy-delete-dir-and-buffer): Add test helper for
diff --git a/test/hui-tests.el b/test/hui-tests.el
index 19ce491b5a..cc67aac880 100644
--- a/test/hui-tests.el
+++ b/test/hui-tests.el
@@ -3,7 +3,7 @@
;; Author: Mats Lidell <matsl@gnu.org>
;;
;; Orig-Date: 30-Jan-21 at 12:00:00
-;; Last-Mod: 10-Dec-23 at 21:11:07 by Mats Lidell
+;; Last-Mod: 26-Dec-23 at 11:54:57 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -942,7 +942,7 @@ With point on label suggest that ibut for rename."
(find-file file)
(org-id-get-create nil)
(re-search-forward ":ID:")
- (should (equal (caar (hui:link-possible-types)) 'link-to-org-id)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-org-id))
(hy-delete-file-and-buffer file)))
;; Global Button link-to-gbut
@@ -952,46 +952,46 @@ With point on label suggest that ibut for rename."
(mocklet ((gbut:file => global-but-file))
(hui:gibut-create "global" "/tmp")
(find-file global-but-file)
- (should (equal (caar (hui:link-possible-types)) 'link-to-gbut)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-gbut))
(hy-delete-file-and-buffer global-but-file)))
;; Explicit Button link-to-ebut
(with-temp-buffer
(ebut:program "label" 'link-to-directory "/tmp")
- (should (equal (caar (hui:link-possible-types)) 'link-to-ebut)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-ebut))
;; Implicit Button link-to-ibut
(with-temp-buffer
(insert "<[ibut]> - \"/tmp\"")
(goto-char 5)
- (should (equal (caar (hui:link-possible-types)) 'link-to-ibut)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-ibut))
;; Bookmarks List link-to-bookmark
(with-temp-buffer
(insert " bookmark ~/bookmarked\n")
(bookmark-bmenu-mode)
- (should (equal (caar (hui:link-possible-types)) 'link-to-bookmark)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-bookmark))
;; Info Node link-to-Info-node
(with-temp-buffer
(insert "(info)node\n")
(goto-char 5)
(Info-mode)
- (should (equal (caar (hui:link-possible-types)) 'link-to-Info-node)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-Info-node))
;; Texinfo Node link-to-texinfo-node
(with-temp-buffer
(insert "@node node\n")
(goto-char 5)
(texinfo-mode)
- (should (equal (caar (hui:link-possible-types)) 'link-to-texinfo-node)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-texinfo-node))
;; Mail Reader Message link-to-mail
(let ((hmail:reader 'gnus-article-mode))
(with-temp-buffer
(gnus-article-mode)
(mocklet ((rmail:msg-id-get => "msg-id"))
- (should (equal (caar (hui:link-possible-types)) 'link-to-mail)))))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-mail))))
;; Directory Name link-to-directory
(let ((dir (make-temp-file "hypb" t)))
@@ -1004,15 +1004,15 @@ With point on label suggest that ibut for rename."
;; behavior?
(with-current-buffer (dired dir)
(goto-char 1)
- (should (equal (caar (hui:link-possible-types))
'link-to-directory)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-directory))
(with-temp-buffer
(insert dir)
(goto-char 4)
- (should (equal (caar (hui:link-possible-types)) 'link-to-ibut)))
;; Expected: link-to-directory
+ (hy-test-helpers:ensure-link-possible-type 'link-to-ibut)) ;;
Expected: link-to-directory
(with-temp-buffer
(insert "/ssh:user@host.org:/home/user/file\n")
(goto-char 4)
- (should (equal (caar (hui:link-possible-types)) 'link-to-ibut))))
;; Expected: link-to-directory
+ (hy-test-helpers:ensure-link-possible-type 'link-to-ibut))) ;;
Expected: link-to-directory
(hy-delete-dir-and-buffer dir)))
;; File Name link-to-file
@@ -1021,15 +1021,15 @@ With point on label suggest that ibut for rename."
(unwind-protect
(let ((hargs:reading-type 'file))
(with-current-buffer (dired temporary-file-directory)
- (should (equal (caar (hui:link-possible-types)) 'link-to-file)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-file))
(with-temp-buffer
(insert temporary-file-directory)
(goto-char 4)
- (should (equal (caar (hui:link-possible-types)) 'link-to-ibut)))
;; Expected: link-to-file
+ (hy-test-helpers:ensure-link-possible-type 'link-to-ibut)) ;;
Expected: link-to-file
(with-temp-buffer
(insert "/ssh:user@host.org:/home/user/\n")
(goto-char 4)
- (should (equal (caar (hui:link-possible-types)) 'link-to-ibut))))
;; Expected: link-to-file
+ (hy-test-helpers:ensure-link-possible-type 'link-to-ibut))) ;;
Expected: link-to-file
(hy-delete-file-and-buffer file)
(hy-delete-dir-and-buffer temporary-file-directory)))
@@ -1039,7 +1039,7 @@ With point on label suggest that ibut for rename."
(progn
(find-file file)
(insert "first")
- (should (equal (caar (hui:link-possible-types)) 'link-to-kcell)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-kcell))
(hy-delete-file-and-buffer file)))
;; Outline Heading link-to-string-match
@@ -1049,7 +1049,7 @@ With point on label suggest that ibut for rename."
(find-file file)
(outline-mode)
(goto-char 1)
- (should (equal (caar (hui:link-possible-types))
'link-to-string-match)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-string-match))
(hy-delete-file-and-buffer file)))
;; Buffer attached to File link-to-file
@@ -1057,7 +1057,7 @@ With point on label suggest that ibut for rename."
(unwind-protect
(progn
(find-file file)
- (should (equal (caar (hui:link-possible-types)) 'link-to-file)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-file))
(hy-delete-file-and-buffer file)))
;; EOL in Dired Buffer link-to-directory (dired dir)
@@ -1065,12 +1065,12 @@ With point on label suggest that ibut for rename."
(unwind-protect
(with-current-buffer (dired dir)
(goto-char 1) ;; EOL does not seem to matter!?
- (should (equal (caar (hui:link-possible-types)) 'link-to-directory)))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-directory))
(hy-delete-dir-and-buffer dir)))
;; Buffer without File link-to-buffer-tmp"
(with-temp-buffer
- (should (equal (caar (hui:link-possible-types)) 'link-to-buffer-tmp))))
+ (hy-test-helpers:ensure-link-possible-type 'link-to-buffer-tmp)))
;; This file can't be byte-compiled without `with-simulated-input' which
;; is not part of the actual dependencies, so:
diff --git a/test/hy-test-helpers.el b/test/hy-test-helpers.el
index f11dd33862..9d920e96cf 100644
--- a/test/hy-test-helpers.el
+++ b/test/hy-test-helpers.el
@@ -3,7 +3,7 @@
;; Author: Mats Lidell <matsl@gnu.org>
;;
;; Orig-Date: 30-Jan-21 at 12:00:00
-;; Last-Mod: 22-Dec-23 at 16:03:21 by Mats Lidell
+;; Last-Mod: 26-Dec-23 at 11:55:42 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -27,6 +27,13 @@
(run-with-timer 0.1 nil (lambda () (exit-recursive-edit)))
(recursive-edit))
+(defun hy-test-helpers:ensure-link-possible-type (type)
+ "At point, ensure `hui:link-possible-types' returns a single TYPE."
+ (let* ((possible-types (hui:link-possible-types))
+ (first-type (caar possible-types)))
+ (should (= (length possible-types) 1))
+ (should (equal (caar (hui:link-possible-types)) type))))
+
(defun hy-test-helpers:should-last-message (msg)
"Verify last message is MSG."
(with-current-buffer (messages-buffer)
- [elpa] externals/hyperbole e995fc8905 050/143: Add test for moving between two sections, (continued)
- [elpa] externals/hyperbole e995fc8905 050/143: Add test for moving between two sections, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 7657601745 043/143: hyrolo-mode-map - bind {n} and {C-c C-n} to the same command, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole e67d0f733f 058/143: Fix edebugging of tests that have not been previously defined, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole fc6df9d652 056/143: Merge remote branch 'rsw' into rsw, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole acec506a2c 061/143: Require hbut so defib is defined, needed for compiling (#430), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 12e714d824 072/143: Move xref extensions to new "hsys-xref.el". Add ibut API extensions, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole a08fd67af3 057/143: Merge pull request #427 from rswgnu/matsl-rsw-add-hyrolo-tests, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 29dda66c3e 059/143: Merge remote branch 'rsw' of hyperbole into rsw, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 19e51dfb0e 009/143: +* hyrolo.el (hyrolo-move-backward, hyrolo-move-forward): Fixes., ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 564c147587 046/143: Add tests for hypb-ert (#429), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 97f4e12386 023/143: hui--link-possible-types - ensure only 1 specific type per test,
ELPA Syncer <=
- [elpa] externals/hyperbole badf1e5281 027/143: Merge remote branch 'rsw' into rsw, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 00d5af41be 039/143: Add Smart Key support for rsw's new ert-results.el package, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 586a568992 054/143: Update ChangeLog, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 84fe259016 064/143: hyrolo.el - Fix *HyRolo* {n} and {p} movement commands, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 7a5e3071b6 097/143: Merge branch 'rsw' of hyperbole into rsw, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole ac7d6ed874 106/143: Remove unused function (#455), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 678f62a79d 105/143: hyperbole-web-search: when service is a func, let it prompt for term, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole c4325885a0 114/143: Add single file match tests for some hyrolo hide and show commands (#458), ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 29fd0c8540 060/143: Update manual for "hsys-flymake.el" and add to hkey-alist, ELPA Syncer, 2024/02/19
- [elpa] externals/hyperbole 721ab10894 063/143: hsys-flymake.el improvements; hyrolo-tests.el improvements, ELPA Syncer, 2024/02/19