[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole c8947dd 47/50: Merge branch 'master' of hyper
From: |
Stefan Monnier |
Subject: |
[elpa] externals/hyperbole c8947dd 47/50: Merge branch 'master' of hyperbole |
Date: |
Wed, 17 Mar 2021 18:44:23 -0400 (EDT) |
branch: externals/hyperbole
commit c8947dd88f916f324aa6e8bfacc3ef69c0db9e7d
Merge: c7d62e1 9ca5b0f
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>
Merge branch 'master' of hyperbole
---
Changes | 18 ++++++++++
test/hbut-tests.el | 82 ++++++++++++++++++++++++++++++++------------
test/hy-test-dependencies.el | 3 +-
3 files changed, 81 insertions(+), 22 deletions(-)
diff --git a/Changes b/Changes
index afe08f7..18a88d6 100644
--- a/Changes
+++ b/Changes
@@ -1,8 +1,26 @@
+2021-03-14 Mats Lidell <matsl@gnu.org>
+
+* test/hbut-tests.el (hbut-ib-link-to-file-with-label-variants): Test
+ variants of label separation chars and lengths
+ (hbut-ib-create-label): Test creation of label
+ (hbut-ib-create-label-fails-if-label-exists): Check creation fails
+ when label exists
+
+* test/hy-test-dependencies.el (package-installed-p): Add
+ with-simulated-input
+
2021-03-13 Bob Weiner <rsw@gnu.org>
* hbut.el (defil): Improved to handle both symbol and string representations
of Hyperbole action types.
+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..4730fc5 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,51 @@
(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-link-to-file-with-label-variants ()
+ (cl-loop for ch in '(?: ?- ?=) do
+ (cl-loop for n from 0 to 3 do
+ (with-temp-buffer
+ (insert "<[demo]>" (make-string n ch) "
\"${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))))
+
+(ert-deftest hbut-ib-create-label ()
+ "Create a label for an implicit button"
+ (with-temp-buffer
+ (insert "\"/tmp\"\n")
+ (goto-char 3)
+ (with-simulated-input "TMP RET"
+ (hui:ibut-label-create)
+ (should (string= "<[TMP]> \"/tmp\"\n" (buffer-string))))))
+
+(ert-deftest hbut-ib-create-label-fails-if-label-exists ()
+ "Creation of a label for an implicit button fails if a label exists."
+ (with-temp-buffer
+ (insert "<[LBL]>: \"/tmp\"\n")
+ (goto-char 14)
+ (with-simulated-input "TMP RET"
+ (condition-case err
+ (hui:ibut-label-create)
+ (error
+ (progn
+ (should (equal (car err) 'error))
+ (should (string-search "ibutton at point already has a label" (cadr
err)))))))))
+
(provide 'hbut-tests)
;;; hbut-tests.el ends here
diff --git a/test/hy-test-dependencies.el b/test/hy-test-dependencies.el
index e06f2ec..364f0c8 100644
--- a/test/hy-test-dependencies.el
+++ b/test/hy-test-dependencies.el
@@ -21,7 +21,8 @@
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(unless (package-installed-p 'el-mock)
(package-refresh-contents)
- (package-install 'el-mock))
+ (package-install 'el-mock)
+ (package-install 'with-simulated-input))
(provide 'hy-test-dependencies)
;;; hy-test-dependencies.el ends here
- [elpa] externals/hyperbole 22439e6 20/50: Add klink ref cmds, ebut:program and defiblink for programmatic creation, (continued)
- [elpa] externals/hyperbole 22439e6 20/50: Add klink ref cmds, ebut:program and defiblink for programmatic creation, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole e999fc7 21/50: Stop man-apropos from matching to log file entries, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole cfc61a3 22/50: Eliminate a number of order-based byte-compilation warnings, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole e3544c8 23/50: Revert improper application of "Use \\0 for matched Nth substitution", Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole f1b2cba 24/50: Add dependency on hvar to resolve use of var:remove-all (#43), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 312c858 25/50: kexport.el - use lowercase HTML tags; mail-address ibtype allow trigger in any major mode, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole a3b9d6d 26/50: Merge branch 'master' of github.com:rswgnu/hyperbole, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 398f8e4 32/50: Add hypb:def-to-buffer to hypb.el for fast def copying, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole a831ef9 36/50: Fix bug #46606 by replacing hkey-define-key with hkey-global-set-key, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 8969fe9 43/50: Merge branch 'master' of hyperbole, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole c8947dd 47/50: Merge branch 'master' of hyperbole,
Stefan Monnier <=
- [elpa] externals/hyperbole db73cf7 19/50: Use \0 for matched Nth substitution (see also commit #c0e48fb3), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 1826307 27/50: Resolve bug#43644 where final double quote was trimmed from strings., Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole f38a8dd 28/50: Fix Hyrolo logicial searches; bug fixes; handle file:// URLs better, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 3469ea3 29/50: Release defil and defal simpler implicit button type create macros, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 6a8154a 33/50: Add first unit tests (#46), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole a44b392 34/50: Add UNIX shell error implicit button support, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole aa6f2f6 38/50: Verify error message from hpath:find is correct (#50), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole aad4494 40/50: Add smart-magit-tab: Do what TAB or RET does, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole d1dcd54 41/50: * Disable magit-auto-revert-mode-enable-in-buffers in hyrolo buffer, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole c7d62e1 46/50: Make defil handle action type symbols and strings, Stefan Monnier, 2021/03/17