[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 1c21784 44/50: Add tests for ib with labels (
From: |
Stefan Monnier |
Subject: |
[elpa] externals/hyperbole 1c21784 44/50: Add tests for ib with labels (#52) |
Date: |
Wed, 17 Mar 2021 18:44:22 -0400 (EDT) |
branch: externals/hyperbole
commit 1c21784e64403ef4fd762174933394da66c72712
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: GitHub <noreply@github.com>
Add tests for ib with labels (#52)
Use test case for defal with function that is now fixed
Add tests for ib with labels
---
Changes | 7 +++++++
test/hbut-tests.el | 52 +++++++++++++++++++++++++++++++---------------------
2 files changed, 38 insertions(+), 21 deletions(-)
diff --git a/Changes b/Changes
index efcdf96..c665194 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,10 @@
+2021-03-12 Mats Lidell <matsl@gnu.org>
+
+* test/hbut-tests.el (hbut-verify-defal, hbut-defal-function): Test defal
+ with function.
+ (hbut-ib-link-to-file-with-label, hbut-ib-url-with-label): Test for
+ implicit buttons with labels.
+
2021-03-11 Bob Weiner <rsw@gnu.org>
* hbut.el (defil, defal): If LINK-EXPR is a function and the button is
diff --git a/test/hbut-tests.el b/test/hbut-tests.el
index 1da63c3..ab7c663 100644
--- a/test/hbut-tests.el
+++ b/test/hbut-tests.el
@@ -63,27 +63,21 @@
(should (looking-at "emacs-version")))
(ibtype:delete 'ibtypes::defal-key)))
-
-;; This test seems to break the ert tests when rerun in the same emacs
-;; process so commenting out for now. As defined now it is an expected
-;; failure anyway.
-;;
-;; (defun hbut-verify-defal (x)
-;; "Verify function i called with X set to the string `test'."
-;; (should (string= x "test")))
-;;
-;; (ert-deftest hbut-defal-function ()
-;; "defal call function should only supply the argument portion of
-;; the button text?"
-;; :expected-result :failed
-;; (defal defal-func 'hbut-verify-defal)
-;; (unwind-protect
-;; (with-temp-buffer
-;; (insert "<defal-func test>")
-;; (goto-char 4)
-;; (action-key)))
-;; (progn
-;; (ibtype:delete 'ibtypes::defal-func)))
+(defun hbut-verify-defal (x)
+ "Verify function i called with X set to the string `test'."
+ (should (string= x "test")))
+
+(ert-deftest hbut-defal-function ()
+ "defal call function should only supply the argument portion of
+the button text"
+ (defal defal-func 'hbut-verify-defal)
+ (unwind-protect
+ (with-temp-buffer
+ (insert "<defal-func test>")
+ (goto-char 4)
+ (action-key)))
+ (progn
+ (ibtype:delete 'ibtypes::defal-func)))
(ert-deftest hbut-defal-fails-on-file-missing ()
(defal defal-path-missing "${hyperb:dir}/\\1")
@@ -144,5 +138,21 @@
(should (looking-at "emacs-version")))
(ibtype:delete 'ibtypes::defil-key)))
+;; Labels
+(ert-deftest hbut-ib-link-to-file-with-label ()
+ (with-temp-buffer
+ (insert "<[emacs]>: \"${hyperb:dir}/DEMO\"")
+ (goto-char 4)
+ (hy-test-helpers:action-key-should-call-hpath:find (concat hyperb:dir
"DEMO"))))
+
+(ert-deftest hbut-ib-url-with-label ()
+ "Should find link but fails with (user-error \"No link found\")"
+ :expected-result :failed
+ (with-temp-buffer
+ (insert "<[PR34]>: \"https://github.com/rswgnu/hyperbole/pull/34\"")
+ (goto-char 4)
+ (let ((browse-url-browser-function 'hbut-defal-url))
+ (action-key))))
+
(provide 'hbut-tests)
;;; hbut-tests.el ends here
- [elpa] externals/hyperbole c7d62e1 46/50: Make defil handle action type symbols and strings, (continued)
- [elpa] externals/hyperbole c7d62e1 46/50: Make defil handle action type symbols and strings, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 6b2c073 49/50: Correct test cases failing on mac (#55), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 4eef4e9 50/50: Install with-simulated-input if not available (#54), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 25ba634 31/50: Add fast window link button creation via {M-o w} with Ace Window., Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 64579b0 30/50: Fix defil with function improper call to regexp-quote, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole fccc0e5 42/50: Limit Action Button function arg to parameter after function name, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 1219e12 35/50: Merge branch 'master' of hyperbole, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 9ca5b0f 45/50: More tests for ib with labels (#53), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole cd36bea 39/50: Add more defal and defil tests (#51), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole aeb5a31 37/50: Add defal defil tests plus some extras (#49), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 1c21784 44/50: Add tests for ib with labels (#52),
Stefan Monnier <=
- [elpa] externals/hyperbole faa061e 48/50: Magit Action/Assist Mouse Key on header line toggles diff/all sections visibility, Stefan Monnier, 2021/03/17