branch: externals/hyperbole
commit 10a2622fdba06a1c3531a4d35c8df2c162784b49
Author: Mats Lidell <mats.lid...@lidells.se>
Commit: GitHub <nore...@github.com>

    Add test for ibut:at-p on a remote path name (#489)
---
 ChangeLog          |  5 +++++
 test/hbut-tests.el | 15 ++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 9586426f01..298ba468bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-03-16  Mats Lidell  <ma...@gnu.org>
+
+* test/hbut-tests.el (hbut-tests--ibut-at-p-identifies-a-remote-pathname):
+    Add test for ibut:at-p on remote path names.
+
 2024-03-15  Mats Lidell  <ma...@gnu.org>
 
 * hycontrol.el (hycontrol-blank-buffer-name): Make name of the blank
diff --git a/test/hbut-tests.el b/test/hbut-tests.el
index f8a6574bb2..a8b4086076 100644
--- a/test/hbut-tests.el
+++ b/test/hbut-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <ma...@gnu.org>
 ;;
 ;; Orig-Date:    30-may-21 at 09:33:00
-;; Last-Mod:     11-Feb-24 at 23:35:14 by Mats Lidell
+;; Last-Mod:     16-Mar-24 at 23:44:27 by Mats Lidell
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -768,6 +768,19 @@ See #10 for the proper way to add an ibutton name.
     (hattr:clear 'hbut:current)
     (should-error (ibut:act))))
 
+(ert-deftest hbut-tests--ibut-at-p-identifies-a-remote-pathname ()
+  "Verify `ibut:at-p' identifies a remote pathname."
+  :expected-result :failed
+  (hattr:clear 'hbut:current)
+  (with-temp-buffer
+    (insert "/ssh:u...@host.org:/home/user/file\n")
+    (goto-char 4)
+    (should (equal (hattr:get (ibut:at-p) 'categ) 'ibtypes::pathname))
+    (goto-char (- (point-max) 5))
+    (should (equal (hattr:get (ibut:at-p) 'categ) 'ibtypes::pathname))
+    (goto-char 8)  ;; ibtypes::mail-address !!
+    (should (equal (hattr:get (ibut:at-p) 'categ) 'ibtypes::pathname))))
+
 ;; This file can't be byte-compiled without the `el-mock' package (because of
 ;; the use of the `with-mock' macro), which is not a dependency of Hyperbole.
 ;;  Local Variables:

Reply via email to