[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 9ca5b0f 45/50: More tests for ib with labels
From: |
Stefan Monnier |
Subject: |
[elpa] externals/hyperbole 9ca5b0f 45/50: More tests for ib with labels (#53) |
Date: |
Wed, 17 Mar 2021 18:44:22 -0400 (EDT) |
branch: externals/hyperbole
commit 9ca5b0f61250a136fca886acb12c5633fd23efda
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: GitHub <noreply@github.com>
More tests for ib with labels (#53)
Use with-simulated-input
Test variants of label separation characters and lengths
Add label creation tests for implicit buttons
---
Changes | 11 +++++++++++
test/hbut-tests.el | 30 ++++++++++++++++++++++++++++++
test/hy-test-dependencies.el | 3 ++-
3 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/Changes b/Changes
index c665194..611f83b 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,14 @@
+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-12 Mats Lidell <matsl@gnu.org>
* test/hbut-tests.el (hbut-verify-defal, hbut-defal-function): Test defal
diff --git a/test/hbut-tests.el b/test/hbut-tests.el
index ab7c663..4730fc5 100644
--- a/test/hbut-tests.el
+++ b/test/hbut-tests.el
@@ -145,6 +145,14 @@ the button text"
(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
@@ -154,5 +162,27 @@ the button text"
(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 aa6f2f6 38/50: Verify error message from hpath:find is correct (#50), (continued)
- [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
- [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 <=
- [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, 2021/03/17
- [elpa] externals/hyperbole faa061e 48/50: Magit Action/Assist Mouse Key on header line toggles diff/all sections visibility, Stefan Monnier, 2021/03/17