aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
authorkobarity2025-01-13 22:38:42 +0900
committerEli Zaretskii2025-02-15 13:24:59 +0200
commit6491fee366f58a831689c57aa31493dd70bc2245 (patch)
tree4bcb4b0d012cd3795b66b977b28890424d3e91fa /test/lisp/progmodes/python-tests.el
parent0f768b8843bcdbbfa1c64aeee64d2de7d62c0d13 (diff)
downloademacs-6491fee366f58a831689c57aa31493dd70bc2245.tar.gz
emacs-6491fee366f58a831689c57aa31493dd70bc2245.zip
Fix string end search in python-nav-end-of-statement
* lisp/progmodes/python.el (python-nav-end-of-statement): Change to look for string delimiter characters and check syntax, instead of looking for string-delimiter syntax. * test/lisp/progmodes/python-tests.el (python-nav-end-of-statement-5): New test. (Bug#75387)
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r--test/lisp/progmodes/python-tests.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index ec0a836cb8f..898e2b036e0 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -3204,6 +3204,30 @@ d = '''d'''
3204 (python-tests-look-at "c'") 3204 (python-tests-look-at "c'")
3205 (pos-eol)))))) 3205 (pos-eol))))))
3206 3206
3207(ert-deftest python-nav-end-of-statement-5 ()
3208 "Test long multi-line string (Bug#75387)."
3209 (let* ((line (format "%s\n" (make-string 80 ?a)))
3210 (lines (apply #'concat (make-list 50 line))))
3211 (python-tests-with-temp-buffer
3212 (concat
3213 "
3214s = '''
3215"
3216 lines
3217 "\\'''"
3218 lines
3219 "'''
3220a = 1
3221")
3222 (python-tests-look-at "s = '''")
3223 (should (= (save-excursion
3224 (python-nav-end-of-statement)
3225 (point))
3226 (save-excursion
3227 (python-tests-look-at "a = 1")
3228 (forward-line -1)
3229 (pos-eol)))))))
3230
3207(ert-deftest python-nav-forward-statement-1 () 3231(ert-deftest python-nav-forward-statement-1 ()
3208 (python-tests-with-temp-buffer 3232 (python-tests-with-temp-buffer
3209 " 3233 "