emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole 81d0449aed 16/16: Merge pull request #366 fro


From: ELPA Syncer
Subject: [elpa] externals/hyperbole 81d0449aed 16/16: Merge pull request #366 from rswgnu/add-pathname-with-line-number-spec-test
Date: Tue, 1 Aug 2023 03:58:13 -0400 (EDT)

branch: externals/hyperbole
commit 81d0449aed6a07c03f5425eedb40282ad3ee1cd8
Merge: 6fb1e9624e 6c51fc1290
Author: Robert Weiner <rsw@gnu.org>
Commit: GitHub <noreply@github.com>

    Merge pull request #366 from rswgnu/add-pathname-with-line-number-spec-test
    
    Add tests for pathname with line number specification
---
 ChangeLog                |  6 ++++++
 test/hmouse-drv-tests.el | 39 ++++++++++++++++++++++++++++++++++++++-
 2 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 5b29dfe082..d50a06b846 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -46,6 +46,12 @@
     of "hbut" which defines 'defal' and prevents compilation error when 
"hibtypes"
     tries to load this.
 
+2023-07-14  Mats Lidell  <matsl@gnu.org>
+
+* test/hmouse-drv-tests.el (hbut-pathname-line-test)
+    (hbut-pathname-line-test-duplicate):  Add tests for pathname with line
+    number specification.
+
 2023-07-13  Mats Lidell  <matsl@gnu.org>
 
 * test/hmouse-drv-tests.el (hbut-pathname-anchor-must-match-all)
diff --git a/test/hmouse-drv-tests.el b/test/hmouse-drv-tests.el
index 99062bce2c..8f33a00dcd 100644
--- a/test/hmouse-drv-tests.el
+++ b/test/hmouse-drv-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <matsl@gnu.org>
 ;;
 ;; Orig-Date:    28-Feb-21 at 22:52:00
-;; Last-Mod:     13-Jul-23 at 00:45:55 by Mats Lidell
+;; Last-Mod:     14-Jul-23 at 23:40:55 by Mats Lidell
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -271,6 +271,43 @@
         (should (string= "hyperbole.el" (buffer-name))))
     (kill-buffer "hyperbole.el")))
 
+(ert-deftest hbut-pathname-line-test ()
+  "Pathname with line number specification."
+  (let ((file (make-temp-file "hypb" nil nil
+                              "Line1\nLine2\n")))
+    (unwind-protect
+        (with-temp-buffer
+          (insert (concat "\"" file ":1\""))
+          (goto-char 2)
+          (action-key)
+          (should (string= file (buffer-file-name)))
+          (should (looking-at "Line1")))
+      (hy-delete-file-and-buffer file))))
+
+(ert-deftest hbut-pathname-line-test-duplicate ()
+  "Pathname with line number specification, duplicate ibut to same file.
+
+BUG: See FIXME: The ibut link goes to the wrong line.  Is there a
+problem with a mix up when there are multiple ibuts to the same
+file but with different lines specifications?"
+  (let* ((file
+          (make-temp-file "hypb" nil nil
+                          "Line1\nLine2\n"))
+         (ibutfile
+           (make-temp-file "hypb" nil nil
+                           (concat "\"" file ":1\"" "\n" "\"" file ":2\"\n"))))
+    (unwind-protect
+        (progn
+          (find-file ibutfile)
+          (forward-line)
+          (should (looking-at-p (concat "\"" file ":2\"")))
+          (forward-char 2)
+          (action-key)
+          (should (string= file (buffer-file-name)))
+          (should (looking-at "Line1"))) ; FIXME: Should be looking a Line2
+      (hy-delete-file-and-buffer file)
+      (hy-delete-file-and-buffer ibutfile))))
+
 (ert-deftest hbut-pathname-anchor-test ()
   "Pathname with anchor."
   (let ((file (make-temp-file "hypb" nil nil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]