[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 13abbb4e86 05/13: Add tests for ebut-link-dir
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 13abbb4e86 05/13: Add tests for ebut-link-directly |
Date: |
Fri, 1 Dec 2023 06:58:08 -0500 (EST) |
branch: externals/hyperbole
commit 13abbb4e8699626f4f51a4b541427b66a0b94294
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: Mats Lidell <mats.lidell@lidells.se>
Add tests for ebut-link-directly
---
ChangeLog | 5 +++++
test/hui-tests.el | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 851b3e05bd..cf6331e058 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-11-30 Mats Lidell <matsl@gnu.org>
+
+* test/hui-tests.el (hui--ebut-link-directly-to-file)
+ (hui--ebut-link-directly-to-dired): Add tests for ebut-link-directly.
+
2023-11-25 Mats Lidell <matsl@gnu.org>
* hyrolo.el: Move private variables before their first use to remove
diff --git a/test/hui-tests.el b/test/hui-tests.el
index 9a203d8fd3..eff3df8897 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: 15-Nov-23 at 01:57:15 by Bob Weiner
+;; Last-Mod: 30-Nov-23 at 18:39:54 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -831,6 +831,57 @@ With point on label suggest that ibut for rename."
(hy-delete-file-and-buffer filea)
(hy-delete-file-and-buffer fileb))))
+(ert-deftest hui--ebut-link-directly-to-file ()
+ "Create a direct link to a file."
+ (let ((filea (make-temp-file "hypb" nil ".txt"))
+ (fileb (make-temp-file "hypb" nil ".txt" "1234567890")))
+ (unwind-protect
+ (progn
+ (delete-other-windows)
+ (find-file fileb)
+ (goto-char (point-max))
+ (split-window)
+ (find-file filea)
+ (with-simulated-input "button RET"
+ (hui:ebut-link-directly (get-buffer-window)
+ (get-buffer-window (get-file-buffer
fileb)))
+ (should (string= (buffer-string) "<(button)>"))
+ (hy-test-helpers-verify-hattr-at-p :actype 'actypes::link-to-file
+ :args (list fileb 11)
+ :loc filea
+ :lbl-key "button")))
+ (hy-delete-file-and-buffer filea)
+ (hy-delete-file-and-buffer fileb))))
+
+(ert-deftest hui--ebut-link-directly-to-dired ()
+ "Create a direct link to a directory in Dired."
+ (let* ((file (make-temp-file "hypb" nil ".txt"))
+ (dir hyperb:dir)
+ dir-buf)
+ (unwind-protect
+ (progn
+ (delete-other-windows)
+ (setq dir-buf (dired dir))
+ (goto-char (point-min))
+ ;; Move point just prior to last colon on the first dired directory
line;
+ ;; With some dired formats, there may be text after the last colon.
+ (goto-char (line-end-position))
+ (skip-chars-backward "^:")
+ (when (/= (point) (point-min))
+ (goto-char (1- (point))))
+ (split-window)
+ (find-file file)
+ (with-simulated-input "button RET"
+ (hui:ebut-link-directly (get-buffer-window) (get-buffer-window
dir-buf))
+ ;; Implicit link should be the `dir' dired directory,
+ ;; possibly minus the final directory '/'.
+ (should (string= (buffer-string) "<(button)>"))
+ (hy-test-helpers-verify-hattr-at-p :actype
'actypes::link-to-directory
+ :args (list
(directory-file-name hyperb:dir)) ; Remove trailing slash!?
+ :loc file
+ :lbl-key "button")))
+ (hy-delete-file-and-buffer file))))
+
;; This file can't be byte-compiled without `with-simulated-input' which
;; is not part of the actual dependencies, so:
;; Local Variables:
- [elpa] externals/hyperbole updated (9d596dcc72 -> 3692855fa8), ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 0702872981 02/13: Verify searching all file types with matches gives @loc> headers, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole f7e0d15ac8 04/13: More kotl mode tests with hyrolo-fgrep, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 4e625d0fb9 01/13: Add test for demo key series M-x dired-other-window example, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole d842b4a0fc 03/13: Test moving to next header, then using action-key to get to record., ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole ae55b5cf79 11/13: Merge pull request #408 from rswgnu/hyrolo-test-cases, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 13abbb4e86 05/13: Add tests for ebut-link-directly,
ELPA Syncer <=
- [elpa] externals/hyperbole 3dd0dc156b 06/13: Add tests for gbut-link-directly, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole e444389cdf 09/13: Merge branch 'master' into hyrolo-test-cases, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 12c2f5d851 12/13: Merge branch 'master' into add-tests-for-ebut-link-directly, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 3692855fa8 13/13: Merge pull request #410 from rswgnu/add-tests-for-ebut-link-directly, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 064c23c30e 07/13: Merge branch 'master' into add-key-series-test-for-braces, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 8d5e95c659 08/13: Merge pull request #406 from rswgnu/add-key-series-test-for-braces, ELPA Syncer, 2023/12/01
- [elpa] externals/hyperbole 68d46e030e 10/13: Merge branch 'master' into add-tests-for-ebut-link-directly, ELPA Syncer, 2023/12/01