branch: externals/hyperbole
commit a04cdffc495e449e5f4a26ef961d3deedce2de0e
Author: Mats Lidell <[email protected]>
Commit: GitHub <[email protected]>

    Test with unbalanced quote on same line as quoted path (#810)
---
 ChangeLog           |  6 ++++++
 test/hpath-tests.el | 13 ++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 4fd5a0b2a3..22b8613776 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-11-11  Mats Lidell  <[email protected]>
+
+* test/hpath-tests.el 
(hpath:path-at-point-finds-path-when-unbalanced-quote-on-same-line):
+    Verify that unbalanced quotes on same line as quoted path does not
+    interfere with finding the path.
+
 2025-11-07  Mats Lidell  <[email protected]>
 
 * hsys-www.el (eww--dwim-expand-url): Declare function to silence warning.
diff --git a/test/hpath-tests.el b/test/hpath-tests.el
index 3519ebd923..a2edccd035 100644
--- a/test/hpath-tests.el
+++ b/test/hpath-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <[email protected]>
 ;;
 ;; Orig-Date:    28-Feb-21 at 23:26:00
-;; Last-Mod:     18-Oct-25 at 12:43:56 by Bob Weiner
+;; Last-Mod:     11-Nov-25 at 16:27:32 by Mats Lidell
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -126,6 +126,17 @@
     (goto-char 7)
     (should (not (hpath:at-p)))))
 
+(ert-deftest hpath:path-at-point-finds-path-when-unbalanced-quote-on-same-line 
()
+  "Find path at point finds a path even with unbalanced quotes on same line."
+  :expected-result :failed
+  (dolist (v '(("  \"/tmp\"  ")       ; Reference case: no quotes
+               ("  \"/tmp\" \"")      ; Quote after: Works
+               ("\" \"/tmp\"  ")))    ; Quote before: FAILS
+    (with-temp-buffer
+      (insert (format "%s\n" v))
+      (goto-char 6)
+      (should (string= (hpath:at-p nil t) "/tmp")))))
+
 (ert-deftest hpath:find-exec-shell-cmd-test ()
   "Path prefix ! will run pathname as a non windowed program."
   (let ((was-called nil))

Reply via email to