Skip to content

Commit 5ea66a6

Browse files
authored
Change test case name and track current behavior with extra quotes (#814)
1 parent 3b7b755 commit 5ea66a6

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2025-11-17 Mats Lidell <matsl@gnu.org>
2+
3+
* test/hpath-tests.el
4+
(hpath:path-at-point-with-unbalanced-quote-on-same-line):
5+
Rename test. Track current behavior.
6+
17
2025-11-16 Mats Lidell <matsl@gnu.org>
28

39
* test/hpath-tests.el (hpath--hpath:delimited-possible-path-in-ls-R):

test/hpath-tests.el

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Mats Lidell <matsl@gnu.org>
44
;;
55
;; Orig-Date: 28-Feb-21 at 23:26:00
6-
;; Last-Mod: 16-Nov-25 at 23:23:37 by Mats Lidell
6+
;; Last-Mod: 17-Nov-25 at 16:40:58 by Mats Lidell
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -126,16 +126,19 @@
126126
(goto-char 7)
127127
(should (not (hpath:at-p)))))
128128

129-
(ert-deftest hpath:path-at-point-finds-path-when-unbalanced-quote-on-same-line ()
130-
"Find path at point finds a path even with unbalanced quotes on same line."
131-
:expected-result :failed
132-
(dolist (v '((" \"/tmp\" ") ; Reference case: no quotes
133-
(" \"/tmp\" \"") ; Quote after: Works
134-
("\" \"/tmp\" "))) ; Quote before: FAILS
135-
(with-temp-buffer
136-
(insert (format "%s\n" v))
137-
(goto-char 6)
138-
(should (string= (hpath:at-p nil t) "/tmp")))))
129+
(ert-deftest hpath:path-at-point-with-unbalanced-quote-on-same-line ()
130+
"Verify `hpath:at-p' behavior when there is an unbalanced quotes on same line."
131+
(dolist (v '((" \"/tmp\" " . t)
132+
(" \"/tmp\" \"" . t)
133+
("\" \"/tmp\" " . nil)))
134+
(let ((text (car v))
135+
(find (cdr v)))
136+
(with-temp-buffer
137+
(insert (format "%s\n" v))
138+
(goto-char 6)
139+
(if find
140+
(should (string= (hpath:at-p nil t) "/tmp"))
141+
(should-not (hpath:at-p nil t)))))))
139142

140143
(ert-deftest hpath:find-exec-shell-cmd-test ()
141144
"Path prefix ! will run pathname as a non windowed program."

0 commit comments

Comments
 (0)